Esempio n. 1
0
 /// <summary>
 ///     Constructor used by inheritence only
 /// </summary>
 /// <param name="words">The words to be used in the wordlist</param>
 public WordList(string[] words, char space, string name)
 {
     _words = words
              .Select(w => MnemonicSequence.NormalizeString(w))
              .ToArray();
     Space = space;
     Name  = name;
 }
Esempio n. 2
0
        /// <summary>
        ///     Method to determine if word exists in word list, great for auto language detection
        /// </summary>
        /// <param name="word">The word to check for existence</param>
        /// <returns>Exists (true/false)</returns>
        public bool WordExists(string word, out int index)
        {
            word = MnemonicSequence.NormalizeString(word);
            if (_words.Contains(word))
            {
                index = Array.IndexOf(_words, word);
                return(true);
            }

            //index -1 means word is not in wordlist
            index = -1;
            return(false);
        }