sn.addPos(pos);
} else {
// ��unknownDict�ʵ���л�ȡ��ǰ�����д���
SegAtom sa = unknownDict.getSegAtom(curWord, gbkID);
for (int j = 0; sa != null && j < sa.getPosCount(); j++) {
Pos pos = sa.getPos(j);
double value = -Math.log((1 + pos.getFreq()));
value += Math.log((context.getFreq(pos.getTag()) + sa.getPosCount() + 1));
AdjoiningPos apos = new AdjoiningPos(pos , value);
sn.addPos(apos);
}
if (Utility.SENTENCE_BEGIN.equals(curWord))
sn.addPos(new AdjoiningPos( 100 , 0));
else if (Utility.SENTENCE_END.equals(curWord))
sn.addPos(new AdjoiningPos( 101 , 0));
else {
int freq = 0;
sa = coreDict.getSegAtom(curWord, gbkID);
if (sa != null) {
double value = -Math.log((double) (1 + freq));
value += Math.log((double) (context.getFreq(0) + sa.getPosCount()));
sn.addPos(new AdjoiningPos( 0 , value));
}
}
}
} else {
if (sn.getPos() > 0) {
int tag = sn.getPos();
double value = -Math.log(1 + sn.getFreq());
value += Math.log(1 + context.getFreq(tag));
if (value < 0)
value = 0;
sn.addPos(new AdjoiningPos( tag, value));
} else {
if (sn.getPos() < 0) {
sn.setPos(-sn.getPos());
sn.addPos(new AdjoiningPos( -sn.getPos(), sn.getFreq()));
}
SegAtom sa = coreDict.getSegAtom(curWord, gbkID);
if (sa != null) {
for (int j = 0; j < sa.getPosCount(); j++) {
Pos pos = sa.getPos(j);
double value = -Math.log(1 + pos.getFreq());
value += Math.log(context.getFreq(pos.getTag()) + sa.getPosCount());
sn.addPos(new AdjoiningPos(pos , value));
}
}
}
}
if (sn.getAllPos() == null)
guessPos(tagType, sn);
// ���һ���ʽڵ��Ӧ��allPosΪnull����˵�����������ɴ�
// ���Ĵ�������һ���ʵĴ���,���ǽ�����ʶ��ĩ##ĩ������
if (i - 1 >= 0 && sns.get(i - 1).getPosSize() == -1) {
if (sn.getPosSize() > 0) {
Pos pos = sn.getAllPos().get(0).getPos();
int ipos = pos.getTag() == POSTag.SEN_END ? POSTag.UNKNOWN : pos.getTag();
AdjoiningPos apos = new AdjoiningPos( ipos , 0);
sns.get(i - 1).addPos(apos);
}
}
}