spencermountain / compromise

modest natural-language processing

Home Page:http://compromise.cool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue adding to Lexicon

MarketingPip opened this issue · comments

There is an issue when adding lexicon that contain values such as (Prepositions, Noun, Verb) etc..

Example:

This works fine!

let lexicon = {
    "the":["hello", "how", "weird"]
}

nlp(`the`, lexicon)

// Outputs
"tags": [
        "hello",
        "how",
        "weird"
      ]

but this does not.

let lexicon = {
    "the":["Adverb","Preposition","Noun","Pronoun","Adjective","Verb","Determiner","Conjunction"]
}

nlp(`the`, lexicon)

// Outputs
 "tags": [
        "Conjunction"
      ]

hey Jared, there are some rules in the internal tags that forbid a word from being two inconsistent tags, such as a Noun and an Adjective.

This is done quietly, so it is sometimes confusing.
You can read a bit about this here
cheers