Exemple #1
0
 public WordStructureRuleList(params object[] objects)
     : base()
 {
     foreach (object obj in objects)
     {
         if (obj is IWordStructureRule)
         {
             this.Add((IWordStructureRule)obj);
         }
         else if (obj is char)
         {
             this.Add(WordStructureChar.FromChar((char)obj));
         }
         else if (obj is string)
         {
             string s = (string)obj;
             if (s.Length > 0)
             {
                 this.Add(new WordStructureString(s));
             }
         }
         else
         {
             throw new ArgumentException("Mismatched type of arguments.");
         }
     }
 }
Exemple #2
0
        public static WordStructureChar operator -(WordStructureChar x, char ch)
        {
            WordStructureChar wordStructureChar = new WordStructureChar(x);

            wordStructureChar._acceptedCharPronunciationDict.Remove(ch);
            return(wordStructureChar);
        }
Exemple #3
0
        public WordStructureChar RemovePronunciationDict()
        {
            WordStructureChar wordStructureChar = new WordStructureChar(this);

            foreach (char key in _acceptedCharPronunciationDict.Keys)
            {
                wordStructureChar._acceptedCharPronunciationDict[key] = "";
            }
            return(wordStructureChar);
        }
Exemple #4
0
 public WordStructureChar(WordStructureChar that)
 {
     _acceptedCharPronunciationDict = new Dictionary <char, string>(that._acceptedCharPronunciationDict);
 }