public CapitalizationFilterFactory(Map<String, String> args) {super(args);boolean ignoreCase = getBoolean(args, KEEP_IGNORE_CASE, false);Set<String> k = getSet(args, KEEP);if (k != null) {keep = new CharArraySet(10, ignoreCase);keep.addAll(k);}k = getSet(args, OK_PREFIX);if (k != null) {okPrefix = new ArrayList<>();for (String item : k) {okPrefix.add(item.toCharArray());}}minWordLength = getInt(args, MIN_WORD_LENGTH, 0);maxWordCount = getInt(args, MAX_WORD_COUNT, CapitalizationFilter.DEFAULT_MAX_WORD_COUNT);maxTokenLength = getInt(args, MAX_TOKEN_LENGTH, CapitalizationFilter.DEFAULT_MAX_TOKEN_LENGTH);onlyFirstWord = getBoolean(args, ONLY_FIRST_WORD, true);forceFirstLetter = getBoolean(args, FORCE_FIRST_LETTER, true);if (!args.isEmpty()) {throw new IllegalArgumentException("Unknown parameters: " + args);}}
public CapitalizationFilterFactory(IDictionary<string, string> args): base(args){AssureMatchVersion();bool ignoreCase = GetBoolean(args, KEEP_IGNORE_CASE, false);ICollection<string> k = GetSet(args, KEEP);if (k != null){keep = new CharArraySet(m_luceneMatchVersion, 10, ignoreCase);keep.UnionWith(k);}k = GetSet(args, OK_PREFIX);if (k != null){okPrefix = new List<char[]>();foreach (string item in k){okPrefix.Add(item.ToCharArray());}}minWordLength = GetInt32(args, MIN_WORD_LENGTH, 0);maxWordCount = GetInt32(args, MAX_WORD_COUNT, CapitalizationFilter.DEFAULT_MAX_WORD_COUNT);maxTokenLength = GetInt32(args, MAX_TOKEN_LENGTH, CapitalizationFilter.DEFAULT_MAX_TOKEN_LENGTH);onlyFirstWord = GetBoolean(args, ONLY_FIRST_WORD, true);forceFirstLetter = GetBoolean(args, FORCE_FIRST_LETTER, true);culture = GetCulture(args, CULTURE, null);if (args.Count > 0){throw new System.ArgumentException("Unknown parameters: " + args);}}