if (curSearchOffset == offset
&& maxDicWordLength < numberSearchLength) {
maxDicWordLength = numberSearchLength;
}
Word word = curSearch.getWord();
if (!word.isNoise()) {
dissectIsolated(collector, beef, curSearchOffset,
curSearch.getIndex());
}
curSearchOffset = numberSearchEnd - 1;
break;
}
if (curSearch.isUnclosed()) {
continue;
}
// 通过词汇表判断,返回判断结果curSearch
curSearch = vocabulary.search(beef, curSearchOffset,
curSearchLength);
// ---------------分析返回的判断结果--------------------------
// 1)
// 从词汇表中找到了该词语...
if (curSearch.isHit()) {
// 1.1)
// 确认孤立字符串的结束位置=curSearchOffset,
// 并调用子方法分解把从isolatedOffset开始的到curSearchOffset之间的孤立字符串
// 孤立字符串分解完毕,将孤立字符串开始位置isolatedOffset清空
if (isolatedOffset >= 0) {
dissectIsolated(collector, beef, isolatedOffset,
curSearchOffset);
isolatedOffset = -1;
}
// 1.2)
// 更新最大结束位置
if (maxDicWordEnd < curSearchEnd) {
maxDicWordEnd = curSearchEnd;
}
// 1.3)
// 更新词语最大长度变量的值
if (curSearchOffset == offset
&& maxDicWordLength < curSearchLength) {
maxDicWordLength = curSearchLength;
}
// 1.2)
// 通知collector本次找到的词语
Word word = curSearch.getWord();
if (!word.isNoise()) {
collector.collect(word.getText(), curSearchOffset,
curSearchEnd);
}
}
// 若isolatedFound==true,表示词典没有该词语