/// <summary> /// 将给定的字符类合并,并返回更新的字符类的映射表。 /// </summary> /// <param name="group">字符类的分组信息。</param> public Dictionary <int, int> MergeCharClass(IEnumerable <IEnumerable <int> > group) { Dictionary <int, int> map = new Dictionary <int, int>(); List <CharSet> newList = new List <CharSet>(); foreach (IEnumerable <int> charClasses in group) { int idx = -1; CharSet set = null; foreach (int cc in charClasses) { if (idx == -1) { set = this.charClassList[cc]; idx = newList.Count; map[cc] = idx; newList.Add(set); } else { map[cc] = idx; set.UnionWith(this.charClassList[cc]); } } } this.charClassList = newList; return(map); }