Skip to content

Commit 125ac3c

Browse files
committed
Merge branch 'pr/621'
2 parents f0dd522 + 9873489 commit 125ac3c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/org/wltea/analyzer/core/AnalyzeContext.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,15 @@ void outputToResult(){
267267
Lexeme l = path.pollFirst();
268268
while(l != null){
269269
this.results.add(l);
270+
//字典中无单字,但是词元冲突了,切分出相交词元的前一个词元中的单字
271+
int innerIndex = index + 1;
272+
for (; innerIndex < index + l.getLength(); innerIndex++) {
273+
Lexeme innerL = path.peekFirst();
274+
if (innerL != null && innerIndex == innerL.getBegin()) {
275+
this.outputSingleCJK(innerIndex - 1);
276+
}
277+
}
278+
270279
//将index移至lexeme后
271280
index = l.getBegin() + l.getLength();
272281
l = path.pollFirst();

0 commit comments

Comments
 (0)