Segmenter.Base.Collectors.FrequencyDictionary.Add C# (CSharp) Method

Add() public method

Maps the specified word to the specified list of cursorPosition in a sequence.
public Add ( string str, List pos ) : void
str string the new word
pos List word's positions in the sequence
return void
        public void Add(string str, List<int> pos)
        {
            try
            {
                words.Add(str, new List<int>(pos));
            }
            catch (Exception)
            {
            }
        }

Usage Example

 public void AddTest()
 {
     var alphabet = new FrequencyDictionary();
     var alphabetTest = new FrequencyDictionary(chain);
     string[] words = { "A", "G", "C", "T" };
     int power = 1;
     alphabet.Add(words[0], alphabetTest[words[0]]);
     alphabet.Add(words[0], alphabetTest[words[0]]);
     Assert.True(alphabet.Contains(words[0]) && alphabet.Count == power);
 }
All Usage Examples Of Segmenter.Base.Collectors.FrequencyDictionary::Add