Skip to content

Commit

Permalink
ignore empty term
Browse files Browse the repository at this point in the history
  • Loading branch information
medcl committed Dec 1, 2017
1 parent 438d528 commit 950575c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ void setTerm(String term, int startOffset, int endOffset, int position) {
if (config.trimWhitespace) {
term = term.trim();
}

//ignore empty term
if(term.length()==0){
return;
}

termAtt.setEmpty();
termAtt.append(term);
if (startOffset < 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ void setTerm(String term, int startOffset, int endOffset, int position) {
if (config.trimWhitespace) {
term = term.trim();
}

//ignore empty term
if(term.length()==0){
return;
}

termAtt.setEmpty();
termAtt.append(term);
if (startOffset < 0) {
Expand Down

0 comments on commit 950575c

Please sign in to comment.