18 using Lucene.Net.Support;
20 namespace Lucene.Net.Analysis
28 internal System.Collections.Generic.IDictionary<char,
NormalizeCharMap> submap;
29 internal System.String normStr;
42 public virtual void Add(System.String singleMatch, System.String replacement)
45 for (var i = 0; i < singleMatch.Length; i++)
47 char c = singleMatch[i];
48 if (currMap.submap == null)
50 currMap.submap =
new HashMap<char, NormalizeCharMap>(1);
52 var map = currMap.submap[c];
56 currMap.submap[c] = map;
60 if (currMap.normStr != null)
62 throw new System.SystemException(
"MappingCharFilter: there is already a mapping for " + singleMatch);
64 currMap.normStr = replacement;
65 currMap.diff = singleMatch.Length - replacement.Length;