/// <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 => Mnemonic.NormalizeString(w)) .ToArray(); _Space = space; _Name = name; }
/// <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 = Mnemonic.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); }