句子边界检测( SBD)
将文本拆分为句子 vanilla 基于规则的方法(即工作时间为-95%).
- 根据时间段、提问和感叹标记拆分文本.
- 略名(大多数)
- 跳过数字/ 货币
- 跳过urls,网站,电子邮件地址,电话nr.
- 算出椭圆和
安装
使用 无数字 :
$ npm install sbd
怎么样
var tokenizer = require('@ckirby/sbd');
var text = "On Jan. 20, former Sen. Barack Obama became the 44th President of the U.S. Millions attended the Inauguration.";
var sentences = tokenizer.sentences(text, optional_options);
// [
// 'On Jan. 20, former Sen. Barack Obama became the 44th President of the U.S.',
// 'Millions attended the Inauguration.',
// ]
选项
var options = {
"preserve_whitespace" : false,
"abbreviations" : null
};
preserve_whitespace: 保留字与句之间的字形白相间空间(否则,将内部空间正常化为单个空间字符,并省去判决间白相间空间).abbreviations: 将原缩写比作其他语言使用的缩写。 别把点用缩写.
捐款
您可以使用 npm test。 。 。 .
如果你觉得有东西不见了,你可以打开一个问题句子和预期结果的问题. 如果代码不明确,请给我一个@mention。 欢迎拉动请求.
构建( 小) 脚本
npm install -g browserify
npm run-script build