Grasshopper

algorithmic modeling for Rhino

Hi,

I´m fighting with some strings at the moment and still can´t get it right.

If I have a list of similar strings. How could there be a possibility to merge i.e. the string "economic" and "economics"  into two "econonomic" strings.

To say just the last one ore two characters differ.

Views: 687

Replies to This Discussion

Are these strings to be merged always adjacent in the list?

Is it always an '*s' that is appended?

--

David Rutten

david@mcneel.com

Would this logic work on your data?

--

David Rutten

david@mcneel.com

Attachments:

Hi David,

thank you very much for this proposal. Unfortunatly it culls also Strings that are very essential. In the end list I would also need to know how many Strings from the first list were removed. Maybe it would be better to work with a replacement. That for instance cats would be replaced by cat and economics by economic.

Hi David,

If I sort the strings according to the character lenght they can be but would not be necessary adjacent.

Its not always an '*s' but sometimes an '*e' sometimes an '*st'. Neverthless the exceptions are in a overviewable range of differences.

Thanks a lot,

Dennis

Hi,

I worked a bit further on this issue and I have to thank you David for the file you made. Unfortunately I came to a point where in a strange sense strings start to duplicate and my programe starts to remove characters which its not supposed to remove. For instance the last character of "Beschleunigungspolitik".

I put a list with 479 Strings in and I get 785 Strings out. I just cant see where they multiply. Does anyone see a solution for this?

Attachments:

In fact the issue on the amount of Strings is solved by taking just the first Item of each branch. Nevertheless I´m still looking for a solution concerning the last characters of certain essential strings.

Maybe I have to look for another method and somehow make groups of character amounts and compare the characters. Does anyone has some experience with this?

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service