public virtual void addWord(char[] seg, int begin, int end, WordType wordType) { if (dictTreeNode == null) { dictTreeNode = new Hashtable(2, 0.8F); } Char keyChar = seg[begin]; DictSegment ds = (DictSegment)dictTreeNode[keyChar]; if (ds == null) { ds = new DictSegment(); dictTreeNode[keyChar] = ds; } if (begin < end) { ds.addWord(seg, begin + 1, end, wordType); } else if (begin == end) { ds.NodeState = 1; ds.wordType.addWordType(wordType); } }
public virtual void addWordType(WordType wordType) { wordTypeValue = wordTypeValue | wordType.wordTypeValue; }
public virtual void addWord(char[] seg, WordType wordType) { addWord(seg, 0, seg.Length - 1, wordType); }
public DictSegment() { nodeState = 0; wordType = new WordType(); }