spencermountain / compromise

modest natural-language processing
http://compromise.cool
MIT License
11.48k stars 653 forks source link

Title-case adjective tagged as a noun #578

Open bmestanov opened 5 years ago

bmestanov commented 5 years ago

Hi, I noticed a behavior I think is strange. See examples:

nlp('when quantity is higher than 16 do X').debug()
====
   'when'                     - Conjunction
   'quantity'                 - Singular, Noun
   'is'                       - Copula, Verb, VerbPhrase
   'higher'                   - Comparative, Adjective
   'than'                     - Preposition
   '16'                       - NumericValue, Value, Cardinal
   'do'                       - Infinitive, PresentTense, Verb, VerbPhrase
   'X'                        - Noun, Singular

Which is OK. But when the adjective is in title-case:

nlp('when quantity is Higher than 16 do X').debug()
===
...
'Higher'                   - TitleCase, Noun, Singular
...

What seems odd to me is that the toLowerCase transformation does not change anything.

nlp('when quantity is Higher than 16 do X').toLowerCase().debug()
===
...
'higher'                   - TitleCase, Noun, Singular
...

Thanks!

spencermountain commented 5 years ago

thanks Bilyal! that looks for sure like a bug. will check it out.