Skip to content

Commit

Permalink
fix condition BaseAutoCompleteAnnotator #2
Browse files Browse the repository at this point in the history
  • Loading branch information
danielecalda committed Oct 6, 2023
1 parent d3e9a32 commit 1f3f6c0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public List<CategorySemantics> annotate(String...tokens) {


if (value instanceof String) {
if (!value.equals(token) || ((String) value).startsWith(token)) {
if (!value.equals(token) && ((String) value).startsWith(token)) {
categorySemantics.add(
CategorySemantics.of(
"$AUTOCOMPLETE",
Expand All @@ -117,7 +117,7 @@ public List<CategorySemantics> annotate(String...tokens) {
}
else if (value instanceof Map) {
for (Map.Entry<?, ?> e2 : ((Map<?, ?>) value).entrySet()) {
if (!e2.getValue().equals(token) || ((String) e2.getValue()).startsWith(token)) {
if (!e2.getValue().equals(token) && ((String) e2.getValue()).startsWith(token)) {
categorySemantics.add(
CategorySemantics.of(
"$AUTOCOMPLETE",
Expand Down Expand Up @@ -183,7 +183,7 @@ private boolean _arrayContains(

@Override
public int getLastTokenCount() {
return 2;
return 3;
}

}

0 comments on commit 1f3f6c0

Please sign in to comment.