Skip to content

Commit

Permalink
Introduced the Word2VecSynonymFilter - check null (apache#12169)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantuzi committed Apr 24, 2023
1 parent bf712b9 commit 8250065
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public Word2VecSynonymFilter(
int maxSynonymsPerTerm,
float minAcceptedSimilarity) {
super(input);
if (synonymProvider == null) {
throw new IllegalArgumentException("The SynonymProvider must be non-null");
}
this.synonymProvider = synonymProvider;
this.maxSynonymsPerTerm = maxSynonymsPerTerm;
this.minAcceptedSimilarity = minAcceptedSimilarity;
Expand Down

0 comments on commit 8250065

Please sign in to comment.