compromise-js 基于 JavaScript 的自然语言处理库 项目简介
compromise 是一个开源的,基于 JavaScript 的自然语言处理库。它支持如下功能:匹配 变形 名词,动词,句子,值 元数据 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()
}
// "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()
}