mirror of https://github.com/apache/lucene.git
Word2VecSynonymFilter constructor null check (#12169)
This commit is contained in:
parent
1f4f2bf509
commit
4deb0003c4
|
@ -65,6 +65,9 @@ public final class Word2VecSynonymFilter extends TokenFilter {
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue