Skip to content

Commit

Permalink
fix: 修复因copy_to导致的offset错误
Browse files Browse the repository at this point in the history
  • Loading branch information
KennFalcon committed Nov 29, 2019
1 parent 985b703 commit a88a696
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/com/hankcs/lucene/HanLPTokenizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ final public boolean incrementToken() throws IOException {
do {
term = segment.next();
if (term == null) {
totalOffset += segment.offset;
return false;
}
if (TextUtility.isBlank(term.word)) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/hankcs/lucene/SegmentWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class SegmentWrapper {
/**
* term的偏移量,由于wrapper是按行读取的,必须对term.offset做一个校正
*/
private int offset;
int offset;

Configuration configuration;

Expand Down

0 comments on commit a88a696

Please sign in to comment.