Author Topic: Word Suffixes  (Read 4624 times)

0 Members and 1 Guest are viewing this topic.

Offline gumby

Word Suffixes
« on: December 09, 2010, 11:39:58 AM »
Here is a complete list of word suffixes, with examples (located in the vocab.901) from the template game.  My understanding is that these are used by the parser if the inputted word cannot be matched in the vocab.000.  Then it attempts to find a match here, and if it does the parser will use the suffixed word class while parsing.  This also explains why there are minimal/no pluralized words in the vocab - you should be able to use the root word & the parse will still work properly.

Note that you cannot use suffixed words in developing Said() strings (however, it may minimize the number of strings you need to write), it just helps out with the user input.

Code: [Select]
  (if(Said('take/knife'))       // This will respond to both 'take knife' & 'take knives'!
       Print("taken")
   )
   (if(Said('take/knives'))      // Will NOT compile, knives is not in the vocab!
       Print("taken")
   )

The asterisks in the table corresponds to the word stem (you can think of it as a wildcard of sorts).

Suffixed endingSuffixed word classOriginal endingOriginal word classExample
*snoun*nounDogs
« Last Edit: December 09, 2010, 10:14:50 PM by gumby »


In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline MusicallyInspired

Re: Word Suffixes
« Reply #1 on: December 09, 2010, 05:25:45 PM »
Fascinating!
Brass Lantern Prop Competition

Offline Collector

Re: Word Suffixes
« Reply #2 on: December 09, 2010, 05:50:45 PM »
How about possessives, i.e. "troll's knife"
KQII Remake Pic

Offline gumby

Re: Word Suffixes
« Reply #3 on: December 09, 2010, 08:38:21 PM »
How about possessives, i.e. "troll's knife"

Yep, sure does:

Code: [Select]
  (if(Said('take/sword<troll'))       // Responds to: 'take troll sword' & 'take troll's sword'
       Print("taken")
   )

I'm assuming the parser is discarding/ignoring the apostrophe & utilizing the first rule in the suffix table (change *s to *), and the result is as if 'take troll sword' was inputted.

Additionally, it will respond to 'take trolls sword', 'take trolles sword', and 'take trolly sword'.  Furthermore, if we make the word troll also an adjective, then 'take trollish sword' & 'take trollest sword' work as well.
« Last Edit: December 09, 2010, 10:11:40 PM by gumby »
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: Word Suffixes
« Reply #4 on: December 10, 2010, 12:17:56 AM »
I can see a need to be able to distinguish between the possessive "troll's" and the plural "trolls".
KQII Remake Pic

Offline gumby

Re: Word Suffixes
« Reply #5 on: December 10, 2010, 01:26:49 PM »
I can see a need to be able to distinguish between the possessive "troll's" and the plural "trolls".
You cannot put apostrophes in a vocab word, either.  The only solution to this (that I can see) would be to pre-process the input & convert the word "troll's" to some other vocab word like "trollpossessive" and add that word in the vocab.

However, I'm having a hard time coming up with a scenario that would be an issue for the parser/game-developer.  What user input (or scenario) did you have in mind?  It could be that the issue can be resolved using some other technique.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Cloudee1

Re: Word Suffixes
« Reply #6 on: December 10, 2010, 01:38:51 PM »
Man Gumby, your are totally kicking ass with this parser stuff.  8)
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Collector

Re: Word Suffixes
« Reply #7 on: December 10, 2010, 01:57:38 PM »
If the apostrophe is simply ignored could a game distinguish "kill troll's dog" from "kill trolls dog". Would the game be able to assume possessive by the inclusion of "dog" or would it ignore the trailing dog? If the dog were of no consequence to the game, it probably would not be in the vocab, but if it is...? However, the "trollpossessive" trick might be enough for most situations, if needed.
KQII Remake Pic

Offline gumby

Re: Word Suffixes
« Reply #8 on: December 10, 2010, 04:24:56 PM »
Man Gumby, your are totally kicking ass with this parser stuff.  8)
I'm not going to give up until it's well understood by everyone & documented...

If the apostrophe is simply ignored could a game distinguish "kill troll's dog" from "kill trolls dog". Would the game be able to assume possessive by the inclusion of "dog" or would it ignore the trailing dog? If the dog were of no consequence to the game, it probably would not be in the vocab, but if it is...? However, the "trollpossessive" trick might be enough for most situations, if needed.

Either input would result in the same action (killing the troll's dog).  When you chain nouns together like that, the 'extra' nouns behave like adjectives (in this case 'troll'), and the dog would be the subject.  Here is what the code would look like:
Code: [Select]
 (if(Said('kill/dog<troll')         // Will match 'kill trolls dog', 'kill troll's dog'
      Print("The dog is dead")
  )

  // could also do this...
  (if(Said('kill/dog[<troll]')       // Will match same inputs as above & simply 'kill dog'
      Print("The dog is dead")
  )


EDIT:  Oh, and the parser won't ignore an included word (except articles - they can affect the parse, but are not necessarily represented in the said string).  Every word must be represented in the said string or it will not match the user input - at least, as far as can tell.
« Last Edit: December 11, 2010, 01:06:25 AM by gumby »
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition


SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.112 seconds with 24 queries.