compromise 是一个开源的,基于 JavaScript 的自然语言处理库。
它支持如下功能:
见Sample Code如下:
nlp(entireNovel).sentences().if('the #Adjective of times').out() // "it was the blurst of times??" nlp('she sells seashells by the seashore.').sentences().toFutureTense().out() // 'she will sell seashells...' if( doc.has('^simon says (shoot|fire) #Determiner lazer') ){ fireLazer() } else { dontFire() }