moos / wordpos

Part-of-speech utilities for node.js based on the WordNet database.
478 stars 41 forks source link

add lexical domain to result #11

Closed kengz closed 8 years ago

kengz commented 8 years ago

as detailed here [https://github.com/Planeshifter/node-wordnet-magic#lexdomain],

The lexical domain of the synset. Each domain category is composed of the word type followed by a dot and then the category name. WordNet has implemented the following domain categories:

For example 'dance' gives lexdomain 'noun.act'

moos commented 8 years ago

This would be a simple matter of mapping the 'lexFilenum' attribute to the lexnames.

An example of how you intend to use this would help in prioritizing this work.

kengz commented 8 years ago

Oh thanks. Though it'd be sweet if we can get the words directly than having to manually translate into the lexnames.

A use case would be for a module to know if it's supposed to perform a function. For example inputting "bot switch on the lights", after tokenizing and some string cleaning, if a token belongs to "noun.act" or "verb.change" in this case it will invoke the function if it is recognized (function = switch on, argument = lights in this case).

Would this be a reasonable addition, i.e. showing the lex name directly. Thanks

moos commented 8 years ago

lexName property is added in v1.1. See lookupAdjective example in readme.

kengz commented 8 years ago

Awesome, thanks!