compromise
compromise 介绍
这这个非常受欢迎的库提供“JavaScript中适度的自然语言处理”。这是非常基本和直接的,甚至可以编译成一个小文件。出于某种原因,其适度的“足够好”的方法使其成为几乎任何需要基本NLP的应用程序的主要候选者。
save yourself from regex-whackamole:
nlp(entireNovel).sentences().if('the #Adjective of times').out()
// "it was the blurst of times??"
move things around:
nlp('she sells seashells by the seashore.').sentences().toFutureTense().out()
// 'she will sell seashells...'
respond to text input:
if( doc.has('^simon says (shoot|fire) #Determiner lazer') ){
fireLazer()
} else {
dontFire()
}
GitHub:https://github.com/spencermountain/compromise
网站描述:开源的,基于 JavaScript 的自然语言处理库