NLPchina / ansj_seg

ansj分词.ict的真正java实现.分词效果速度都超过开源版的ict. 中文分词,人名识别,词性标注,用户自定义词典

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

为什么这个自定义词识别不出来?

yaoliweb opened this issue · comments

    DicLibrary.insert(DicLibrary.DEFAULT, "南通市崇川区南川园路");
    Result result = ToAnalysis.parse("南通市崇川区南川园路南川园新村xx幢yy单元mm室");
    List<Term> terms = result.getTerms();
    for (Term term : terms) {
        System.out.print(term.getName() + "\t");
    }

结果显示为:南通市 崇 川 区 南川 园 路南 川 园 新村 xx 幢 yy 单元 mm 室
而如果设置为
DicLibrary.insert(DicLibrary.DEFAULT, "南通市崇川区南川园");
Result result = ToAnalysis.parse("南通市崇川区南川园路南川园新村xx幢yy单元mm室");
List terms = result.getTerms();
for (Term term : terms) {
System.out.print(term.getName() + "\t");
}
结果显示:南通市崇川区南川园 路南 川 园 新村 xx 幢 yy 单元 mm 室
少了一个“路”字就能识别出来,否则识别不出来,请问是哪里没有设置对么?或者是Bug?

commented