ME-126 / ictclas4j

Automatically exported from code.google.com/p/ictclas4j
0 stars 0 forks source link

segGraph.insert(usn, true); 会吃掉一些字 #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
对"欧阳炎炎、欧阳修、西门吹雪"进行分词时 
产生的结果是 "欧阳/nr 炎炎/z 、/w 修/nr 、/w 西门/nr 吹/v 雪/n 
"
"欧阳修"的"欧阳" 被 segGraph.insert "吃掉了".注释掉就会没问题
请问segGraph.insert的作用是什么.
去掉会有什么后果?

注:segGraph.insert 分别在 
PosTagger 中 528行 segGraph.insert(usn, true);
PosTagger 中 600行 segGraph.insert(newsn, true);

Original issue reported on code.google.com by ph.lemon on 9 Jun 2007 at 1:08

GoogleCodeExporter commented 9 years ago
应该不是segGraph.insert的错误,我发现好像是人名识别部分出��
�了,看这里
http://tinypig.javaeye.com/blog/250926

Original comment by chinac...@gmail.com on 10 Oct 2008 at 11:51

GoogleCodeExporter commented 9 years ago
svn上的ictcals4j 会造成 英文无法正常分词的问题。
中国上海SUM STUDIO
结果是
中国/n 上海/n / /

debug发现问题在 org.ictclas4j.segment.AdjustSeg.finalAdjust 
对英文的匹配出了问题

else if (wr.getPos() == POSTag.NOUN_LETTER && i + 1 < optSegPath.size()) {
    SegNode wr2 = new SegNode();
    wr2.setWord(wr.getSrcWord());
    wr2.setPos(POSTag.NOUN_LETTER);
while (true) {

将上面的代码修改为下面的就可以了,其实就是要clone一个wr�
��wr2
else if (wr.getPos() == POSTag.NOUN_LETTER && i + 1 < optSegPath.size()) {
    SegNode wr2 = new SegNode();
    wr2.setSrcWord(wr.getSrcWord());
    wr2.setWord(wr.getSrcWord());
    wr2.setPos(POSTag.NOUN_LETTER);
    wr2.setAllPos(wr.getAllPos());
while (true) {

Original comment by caritas2...@gmail.com on 25 Oct 2011 at 3:51