示例#1
0
        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);
            }
        }
示例#2
0
 public virtual void  addWordType(WordType wordType)
 {
     wordTypeValue = wordTypeValue | wordType.wordTypeValue;
 }
示例#3
0
 public virtual void  addWord(char[] seg, WordType wordType)
 {
     addWord(seg, 0, seg.Length - 1, wordType);
 }
示例#4
0
 public DictSegment()
 {
     nodeState = 0;
     wordType  = new WordType();
 }