Picking out words

I want to know if there is an easy way to have GS pick out a word from a string of letters. For example:

qwcatwaw - and have it pick out cat or qbrushws - and have it pick out brush

Comments

  • polimerjonespolimerjones Member Posts: 50
    I want to know if there is an easy way to have GS pick out a word from a string of letters. For example:

    qwcatwaw - and have it pick out cat or qbrushws - and have it pick out brush
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879
    edited June 2013
    Merged the two discussions. Please don't make multiple discussions on the same topic.

    Try something like this:
  • polimerjonespolimerjones Member Posts: 50
    sorry about that.

    thanks for the help but i was needing it to work for all words.

    so if i typed any random set of letters it could pick out any words i made.

    I saw the 60,000 word template. Is there a way to use the if contains with the word list?
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879
    Yes -- that little demo is the seed for doing just what you ask. You can create some text input routine and stick your text input into that 'game.letterString' attribute. Then it will always check for 'cat'

    I haven't looked in quite a while, but I bet the 60,000 word template, probably has the same 'contains' rule for each of the 60,000 words -- or something very similar to it. (Unless its simply a list of words without any rules.)
  • polimerjonespolimerjones Member Posts: 50
    But the 60,000 word template is reversed. The way its setup you type a word and then it checks if its a real word. It doesnt work the other way around.

    I also hope im explaining this right.

    basically i have an actor that randomly generates 8 letters like aexantwg

    what im wanting is a way to check if those random letters make any words.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879
    I guess its late in my locale and I am not following very well.

    Whats the difference whether someone types in 8 characters, or the computer generates 8 characters. The template is still checking the string of 8 letters against all 60,000 words -- isn't it?
  • polimerjonespolimerjones Member Posts: 50
    no difference but the checker cant check a string of letters for words. only words

    example cat would be true as a real work that the program could find

    but the 8 generated letters wxcatxwx would be false.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879
    edited June 2013
    ................

    Edit -- Oh... wait.... I think I see the challenge now. In the template, the left side of the comparison held a whole list of words. And the test word was on the right side. You want the exact opposite. (Exactly as you have been trying to tell me.)

    That means that you would need to make a test for all 60,000 words. Its probably possible. But also probably quite painful. Sorry!
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879
    edited June 2013
    @polimerjones

    Ok -- I think I have a solution to your question. The attached file uses the words found in @TShirtbooth's 60,000 word template. It takes a string of 10 letters and finds all the possible words contained in the string. If you read from left to right, a ten character string of letters has 45 possible words combinations. There are possibly; 9 two-letter words, 8 three-letter words, 7 four-letter words, 6 five-letter words, 5 six-letter words, 4 seven-letter words, 3 eight-letter words, 2 nine-letter words, and 1 ten-letter word. (Of course, I don't know of any ten character string of letters that can satisfy all 45 possible combinations.)

    Anyway, I hope this demo is helpful.

    http://www.mediafire.com/download/3z6dqxurkcn23cd/wordFinder60000.zip
  • HopscotchHopscotch Member, PRO Posts: 2,782
    Nice work @RThurman! I coudn't even catch you out on cross word or word snippet combinations! You covered it all. :D
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879
    edited June 2013
    @Hopscotch -- yes word snippets can be a problem if not handled properly. In this case, I needed to include the word delimiters (the commas) in order for it to only track whole words.

    The word database does include inflections (even some unusual ones), but it does not include contractions and/or hyphenations. Of course, one could install a different word list. I recall some demos floating around the forum using a 140,000 word list.
Sign In or Register to comment.