Lexicon is a collection of {@link simplenlg.framework.WordElement} objects; it does not do anymorphological processing (as was the case in simplenlg V3). Information about WordElement can be obtained from a database ( {@link simplenlg.lexicon.NIHDBLexicon}) or from an XML file ( {@link simplenlg.lexicon.XMLLexicon}). Simplenlg V4 comes with a default (XML) lexicon, which is retrieved by the getDefaultLexicon method. There are several ways of retrieving words. If in doubt, use lookupWord. More control is available from the getXXXX methods, which allow words to retrieved in several ways Noun Noun getWords: get all matching {@link simplenlg.framework.WordElement} in the Lexicon. For example,getWords("dog") would return a List of two WordElement, one for the noun "dog" and one for the verb "dog". If there are no matching entries in the lexicon, this method returns an empty collection getWord: get a single matching {@link simplenlg.framework.WordElement} in the Lexicon. For example,getWord("dog") would a for either the noun "dog" or the verb "dog" (unpredictable). If there are no matching entries in the lexicon, this method will create a default WordElement based on the information specified. -
hasWord: returns true if the Lexicon contains at least one matching WordElement | |
| |
| |
| |
| |
| |
| |
| |
| |
| |