Ejemplo n.º 1
0
 public DawgBuilder WithOrderedWordsFromFile(string fileName)
 {
     using (var source = new WordListFileSource(fileName))
     {
         return(WithOrderedWords(source));
     }
 }
Ejemplo n.º 2
0
        public void Build_OrderedWordsFile_CreatesDawgFromOrderedWords(DawgType dawgType)
        {
            string[] subset;
            using (var source = new WordListFileSource("scrabble-polish-words.txt"))
            {
                subset = source.Take(1000).ToArray();
                File.WriteAllLines("tmp-words-subset.txt", subset);
            }

            var result = new DawgBuilder().WithOrderedWordsFromFile("tmp-words-subset.txt").BuildDawg(dawgType);

            AssertHaveProvidedWords(result, subset);
        }