AddWord() public method

public AddWord ( string word, int freq, string tag = null ) : void
word string
freq int
tag string
return void
Example #1
0
 public void AddWord(string word, int freq = 0, string tag = null)
 {
     if (freq <= 0)
     {
         freq = WordDict.SuggestFreq(word, Cut(word, hmm: false));
     }
     WordDict.AddWord(word, freq);
 }
Example #2
0
        public void AddWord(string word, int freq = 0, string tag = null)
        {
            if (freq <= 0)
            {
                freq = WordDict.SuggestFreq(word, Cut(word, hmm: false));
            }
            WordDict.AddWord(word, freq);

            // Add user word tag of POS
            if (!string.IsNullOrEmpty(tag))
            {
                UserWordTagTab[word] = tag;
            }
        }