Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
austin007008 committed Jul 9, 2024
1 parent 8981eb8 commit 893c5ad
Showing 1 changed file with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -434,27 +434,17 @@ protected String generatePhrase(WordsAndScores[] terms) {
int start = (int) (beforeIndex - (origHalfSize * 2));
trimBeginning(termsToOutput, beforeIndex, start);
}
// join everything together with spaces while skipping null offsets
return joiner.join(termsToOutput);
} else if (aft) { // if direction is "after", set everything before the first hit term to null
} else { // if direction is "after", set everything before the first hit term to null
for (int k = 0; k < afterIndex; k++) {
termsToOutput[k] = null;
}
if (trim) {
int start = (int) (afterIndex + (origHalfSize * 2));
trimEnd(termsToOutput, afterIndex, start);
}
// join everything together with spaces while skipping null offsets
return joiner.join(termsToOutput);
} else {
if (!trim) {
// join everything together with spaces while skipping null offsets
return joiner.join(termsToOutput);
} else {
// join everything together with spaces while skipping null offsets (after trimming both sides down to what we need)
return joiner.join(bothTrim(termsToOutput));
}
}
// join everything together with spaces while skipping null offsets
return joiner.join(termsToOutput);
}
}

Expand Down

0 comments on commit 893c5ad

Please sign in to comment.