int identifiedEnd = offset;
// ���ڶ�λδ�ִܷʵĿ�Ŀ�ʼλ�ã�e.g '��'
int unidentifiedIndex = -1;
//���ڸ����ж��Ƿ����shouldAWord()����
int maxWordLength = 0;
Hit word = null;
for (setup = offset, end = offset; setup < beaf.length()
&& CharSet.isCjkUnifiedIdeographs(beaf.charAt(setup)); end = ++setup) {
for (int count = 1; end < beaf.length()
&& CharSet.isCjkUnifiedIdeographs(beaf.charAt(end++)); count++) {
//��һ��forѭ��ʱ��end=setup+1
word = vocabulary.search(beaf, setup, count);
if (word.isUndefined()) {
if (unidentifiedIndex < 0 && setup >= identifiedEnd) {
unidentifiedIndex = setup;
}
break;
} else if (word.isHit()) {
if (identifiedEnd < end) {
identifiedEnd = end;
}
if (unidentifiedIndex >= 0) {
dissectUnidentified(collector, beaf, unidentifiedIndex,
setup - unidentifiedIndex);
unidentifiedIndex = -1;
}
collector.collect(word.getWord(), setup, end);
if (setup == offset && maxWordLength < count) {
maxWordLength = count;
}
if (!(word.isUnclosed() && end < beaf.length()// ����ж���Ϊ�����жϷ���
&& beaf.charAt(end) >= word.getNext().charAt(count))) {
break;
}
}
}
}