public PosBinRule(CPOS pos) { m_POS = pos; m_PosBinTbl = new Hashtable(); foreach (T_POSBin bin in m_PosBins) { m_PosBinTbl[bin.HashCode] = true; } }
public MatchName(CPOS pos) { m_PosBinRule = new PosBinRule(pos); m_Pos = pos; m_ChsNameTraffic = new CChsNameTraffic(); m_FamilyNameTbl = new Hashtable(); foreach (String familyName in FAMILY_NAMES) { m_FamilyNameTbl[familyName] = true; } }
public int ProcRule(List <String> preWords, int index, List <String> retWords) { String word = (String)preWords[index]; bool isReg; int pos = CPOS.GetPosFromInnerPosList(m_POS.GetPos(word, out isReg)); String num; if ((pos & (int)T_POS.POS_A_M) == (int)T_POS.POS_A_M) { num = word; int i = 0; for (i = index + 1; i < preWords.Count; i++) { String next = (String)preWords[i]; int nextPos = CPOS.GetPosFromInnerPosList(m_POS.GetPos(next, out isReg)); if ((nextPos & (int)T_POS.POS_A_M) == (int)T_POS.POS_A_M) { num += next; } else { break; } } if (num == word) { return(-1); } else { retWords.Add(num); return(i); } } else { return(-1); } }
public MergeNumRule(CPOS pos) { m_POS = pos; }