diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index daf1887e84d..2f391e4f5e0 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -204,6 +204,8 @@ Improvements * GITHUB#13043: Support getMaxScore of ConjunctionScorer for non top level scoring clause. (Shintaro Murakami) +* GITHUB#13055: Make DEFAULT_STOP_TAGS in KoreanPartOfSpeechStopFilter immutable (Dmitry Cherniachenko) + Optimizations --------------------- diff --git a/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/KoreanPartOfSpeechStopFilter.java b/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/KoreanPartOfSpeechStopFilter.java index 3480e376788..553fa262a87 100644 --- a/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/KoreanPartOfSpeechStopFilter.java +++ b/lucene/analysis/nori/src/java/org/apache/lucene/analysis/ko/KoreanPartOfSpeechStopFilter.java @@ -16,6 +16,7 @@ */ package org.apache.lucene.analysis.ko; +import java.util.Collections; import java.util.EnumSet; import java.util.Set; import org.apache.lucene.analysis.FilteringTokenFilter; @@ -33,37 +34,38 @@ public final class KoreanPartOfSpeechStopFilter extends FilteringTokenFilter { /** Default list of tags to filter. */ public static final Set DEFAULT_STOP_TAGS = - EnumSet.of( - POS.Tag.EP, - POS.Tag.EF, - POS.Tag.EC, - POS.Tag.ETN, - POS.Tag.ETM, - POS.Tag.IC, - POS.Tag.JKS, - POS.Tag.JKC, - POS.Tag.JKG, - POS.Tag.JKO, - POS.Tag.JKB, - POS.Tag.JKV, - POS.Tag.JKQ, - POS.Tag.JX, - POS.Tag.JC, - POS.Tag.MAG, - POS.Tag.MAJ, - POS.Tag.MM, - POS.Tag.SP, - POS.Tag.SSC, - POS.Tag.SSO, - POS.Tag.SC, - POS.Tag.SE, - POS.Tag.XPN, - POS.Tag.XSA, - POS.Tag.XSN, - POS.Tag.XSV, - POS.Tag.UNA, - POS.Tag.NA, - POS.Tag.VSV); + Collections.unmodifiableSet( + EnumSet.of( + POS.Tag.EP, + POS.Tag.EF, + POS.Tag.EC, + POS.Tag.ETN, + POS.Tag.ETM, + POS.Tag.IC, + POS.Tag.JKS, + POS.Tag.JKC, + POS.Tag.JKG, + POS.Tag.JKO, + POS.Tag.JKB, + POS.Tag.JKV, + POS.Tag.JKQ, + POS.Tag.JX, + POS.Tag.JC, + POS.Tag.MAG, + POS.Tag.MAJ, + POS.Tag.MM, + POS.Tag.SP, + POS.Tag.SSC, + POS.Tag.SSO, + POS.Tag.SC, + POS.Tag.SE, + POS.Tag.XPN, + POS.Tag.XSA, + POS.Tag.XSN, + POS.Tag.XSV, + POS.Tag.UNA, + POS.Tag.NA, + POS.Tag.VSV)); /** * Create a new {@link KoreanPartOfSpeechStopFilter} with the default list of stop tags {@link