compromise-js基于 JavaScript 的自然語言處理庫
compromise 是一個(gè)開源的,基于 JavaScript 的自然語言處理庫。
它支持如下功能:
- 匹配
- 變形
- 名詞,動(dòng)詞,句子,值
- 元數(shù)據(jù)
- ngram
- 同義詞等等
見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()
}
評論
圖片
表情
