Skip to content

Commit

Permalink
Word2VecSynonymFilter constructor null check (#12169)
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrobenedetti committed May 30, 2023
1 parent 64b48b8 commit 34e5905
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 34e5905

Please sign in to comment.