Exemplo n.º 1
0
 public Word(Word other) : this(other.Syllables)
 {
 }
        public void AddDefaultDictionaryWords()
        {
            string[] strings = new string[]
            {
                "Procedure",
                "Decided",
                "Example",
                "Directly",
                "Important",
                "Consider",
                "Completely",
                "Advantage",
                "Agenda",
                "Mistaken",
                "Forgetful",
                "Exactly",
                "Iconic",
                "Nutrition",
                "Unwieldy"
            };

            Word procedure  = new Word(new string[] { "pro", "ce", "dure" });
            Word decided    = new Word(new string[] { "de", "ci", "ded" });
            Word example    = new Word(new string[] { "ex", "am", "ple" });
            Word directly   = new Word(new string[] { "dir", "ect", "ly" });
            Word important  = new Word(new string[] { "im", "por", "tant" });
            Word consider   = new Word(new string[] { "con", "si", "der" });
            Word completely = new Word(new string[] { "com", "plete", "ly" });
            Word advantage  = new Word(new string[] { "ad", "van", "tage" });
            Word agenda     = new Word(new string[] { "a", "gen", "da" });
            Word mistaken   = new Word(new string[] { "mis", "tak", "en" });
            Word forgetful  = new Word(new string[] { "for", "get", "ful" });
            Word exactly    = new Word(new string[] { "ex", "act", "ly" });
            Word iconic     = new Word(new string[] { "i", "con", "ic" });
            Word nutrition  = new Word(new string[] { "nu", "tri", "tion" });
            Word unwieldy   = new Word(new string[] { "un", "wiel", "dy" });

            List <Word> words = new List <Word>();

            words.Add(procedure);
            words.Add(decided);
            words.Add(example);
            words.Add(directly);
            words.Add(important);
            words.Add(consider);
            words.Add(completely);
            words.Add(advantage);
            words.Add(agenda);
            words.Add(mistaken);
            words.Add(forgetful);
            words.Add(exactly);
            words.Add(iconic);
            words.Add(nutrition);
            words.Add(unwieldy);

            if (words.Count != strings.Length)
            {
                Debug.LogError("Default of initialization of word dictionary encountered mismatching lengths of word vs syllable lists");
            }
            else
            {
                for (int i = 0; i < strings.Length; i++)
                {
                    //List<Syllable> syllables = new List<Syllable>(words[i].Syllables);
                    //Add(strings[i].ToLower(), syllables);
                    Add(strings[i].ToLower(), words[i].Syllables);
                }
            }
        }