User Tag List

Results 1 to 7 of 7

Thread: Find text lines containing selected words no matter the order

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Fuuriokun's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    243
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Question Find text lines containing selected words no matter the order

    Hi, I'm trying to make a search function for an app, it should show all the lines containing all the words selected.
    Alternatively I would like to list all the lines that contain at least one of the words, sorted by the one that have more words to the one that have less words matching. (this sounds a lot more complex, I know)

    Can someone help me?

  2. #2
    Clicker Fusion 2.5 DeveloperiOS Export Module
    butterfingers's Avatar
    Join Date
    Apr 2012
    Location
    London
    Posts
    135
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    What format are the words you are searching for in?
    Is it a separate text file? Something the user has typed? Some text stored in the game itself?

    Off the top of my head, the List object has functionality to search for strings within it's contents, but without a bit more detail, it's hard to say.

  3. #3
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Fuuriokun's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    243
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I'm trying to make is:
    I have a list of phrases, I want to find a similar text line, but removing "stop words" first, this should keep only key words.
    (stop words are words that are too frequent and are not important to the search)

    So, first I have a new text line, it should remove a list of stop words from it
    Then it must find a line that contain all the words that are left from the action above, no matter the order the words (just like google)
    If there's no line containing all the words, it should show the line containing the line that have most of the words (at least one word should match, but optimally it should have it all)

    It will be used in an app. The List search seem to only find words in the exactly order it's typed...

  4. #4
    Clicker Fusion 2.5 DeveloperiOS Export Module
    butterfingers's Avatar
    Join Date
    Apr 2012
    Location
    London
    Posts
    135
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Ok, that makes sense,
    So, you can use the string tokeniser to remove the stop words, not sure the exact method, but it gives you the tools to split up a string, remove words you don't want and reconstruct it. You could simply make ALL your Stop words into delimiters, and the only words left would be ones that aren't stop words.

    For the actual searching bit,
    I'm assuming you mean that if I type my phrase as:
    "What is it like to eat a Hedgehog?"

    You would just search for "Eat" and "Hedgehog"

    If you have a list of 10 phrases, you can search each line in the list for "Eat" and give it a score of 1 if it contains "Eat".
    Then search again for "Hedgehog", and increase the score to 2 for any lines including "Hedgehog"

    The line with the highest score would be the one containing the most matching words.

  5. #5
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Fuuriokun's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    243
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Never thought of using string tokenizer, it sounds better than using a fast loop with a list... (I just hope it supports the use of 447 delimiters)
    The search part, sounds simple but effective... I'll try it right now!

  6. #6
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Fuuriokun's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    243
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Found a problem in using string tokenizer for removing stop words...
    It will get the stop word even if it makes part of another word
    I guess I'll stick with the fast loop for now, I'll try the search part

    Edit: I guess I could add space in the begining and end of the stop words, but I would stop working with the first and last word in the line...

  7. #7
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    643
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Just search for your word + a space, like search for "yourwordhere"+" ". Then if that word is part of another word (like you're searching for "an", but have "another" in the list) it won't return it. You could also cover your bases and search for "yourwordhere"+"." and for commas too, and also a space at the beginning or spaces on both sides etc.

Similar Threads

  1. Replies: 9
    Last Post: 15th March 2017, 03:18 AM
  2. Replies: 2
    Last Post: 4th November 2016, 11:05 AM
  3. Parsing text by whole words onto lines with character limits?
    By ratty in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 14th May 2013, 03:36 AM
  4. Wildcard possible with - Rich Text Object: Controls > Find > Find and Select Text ??
    By ratty in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 22nd March 2013, 01:28 PM
  5. does the order of AND conditionals matter?
    By infinitum3d in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 26th July 2012, 07:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •