AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Converting Singular to Plural Nouns
 
 

I created an output macro for converting singular to plural nouns:

outputmacro: ^PLURAL( ^ARG1 )  ^POS(NOUN ^ARG1 PLURAL)

The macro returns “deers” for the plural of “deer” and it should be “deer”.

In the file DICT\d.txt I added “plural=deer” to the entry below:

deer ( meanings=1 glosses=1 NOUN NOUN_SINGULAR KINDERGARTEN ) plural=deer
  cervid~1nz (ruminant~1n) distinguished from Bovidae by the male’s having solid deciduous antlers

The User’s guide states that I probably will not want to edit the dictionary entries, but what if I want to?  I see a dict.bin file.  I have visual studio 2010.  I do not see it in the solution.  I rebuilt the project and restarted the chatscript.exe but the macro still returns deers.  In the Users Guide it states that the LIVEDATA folder extends the dictionary and that an advanced user could add to it.  How would I add additional dictionary entries?  Can I override a dictionary entry in the DICT folder with an entry in the LIVEDATA folder for deer? 

What is the best way to create/edit information returned by the ^POS(NOUN ^ARG1 PLURAL) function?

Thanks.

 

 
  [ # 1 ]

When you edit a text dictionary file, remove the dict.bin file. The system will then rebuild that file from your text data.
For adding new entries there are various ways, but since you are trying to alter an existing entry, your only choice is via the text file edit.

In this case, you could also ask me to add “NOUN_MASS” to the entry permanently, so you don’t have to reedit each time I redeliver chatscript.

 

 
  [ # 2 ]

I have tried to remove the dict.bin file and then execute the chatscript.exe file.  It appeared to hang in the DOS window after displaying “Full DicitonaryCode”.  I waited a half hour not-knowing how long it would take to rebuild the dictionary.  Not being very patient, (if I was patient I would be writing a chatbot in pure AIML)  I closed the window and tried again after restoring the DICT folder from a fresh download.  The dict.bin was rebuilt and relaunching chatscript.exe was successful. 

So I analyzed the dictionary entry again.  Evidentally adding a plural=deer to the end of the entry does not actually specify the text to use as a the plural word but instead references another entry in the dictionary.  I seemed to have created a self referencing entry with the folloing line:
deer ( meanings=1 glosses=1 NOUN NOUN_SINGULAR KINDERGARTEN ) plural=deer

I see other entries ending in plural references to “singular” dictionary entries so I am not sure about the syntax and use of “plural=xxx” at the end of a dictionary entry.

I tried the following which seemed to work:
deer ( meanings=1 glosses=1 NOUN NOUN_SINGULAR NOUN_PLURAL KINDERGARTEN )


alaric:_> :testoutput ^plural(deer)
output: deer

Please confirm the use of NOUN_SINGULAR and NOUN_PLURAL for the same dictionary entry if the word can be both singular and plural.  Are there any drawbacks to this?

I am interested in what the NOUN_MASS attribute/flag means and also how KINDERGARTEN is used.  Thanks.

 

 
  [ # 3 ]

NOUN_MASS is for things like sand, which require NO determiner and whose singular and plural are the same.

I ate deer. 

The system records in the dictionary what grade level a word is learned. In your world this probably has no significance.
You can write a character who can pretend to be a 5year old, and recognize when it should not know a word.


Yes, other than adding flags, words refer to other entries and it can be tricky to get them correctly referenced.  Would you like me to fix deer in future releases?

 

 
  [ # 4 ]

I looked into the concept of mass nouns further.  Is seems that mass nouns are collections or aggregations that are uncountable such as sand or water.  Another unit is needed to count them such as 1 grain of sand or 2 cups of water.  Deer are countable.  I saw 3 deer.  So I believe it is correct to not label deer as a mass noun.  Thanks.

 

 
  [ # 5 ]

Yes, deer is NOT a mass noun. But currently, while the system “knows” that deer is both singular and plural in its raw dictionary data, there are issues in pos-tagging a noun which is both singular AND plural. So for safety/simplicity it marks such nouns as only singular.  I will have to work on improving pos-tagging over the next month so I can allow the dictionary to accept nouns which are dual status.

 

 
  [ # 6 ]

This is just off the top of my head, but it seems to me that perhaps when looking at a noun with regard to quantity, there should perhaps be three designations: Singular, Plural and Dual. Or I could be completely off my nut, here. cheese

 

 
  login or register to react