Example #1
0
        private static void Process(
            bool addNewWords        = false,
            bool createStemMapFile  = false,
            bool generateDictionary = false,
            bool runTests           = false)
        {
            var sw = new Stopwatch();

            sw.Start();

            if (addNewWords)
            {
                if (AddNewWordsToWordList())
                {
                    Console.WriteLine(@"New Word List Constructed: " + sw.Elapsed);
                }
                else
                {
                    Console.WriteLine(@"undefined words in word list. Aborting...");
                    return;
                }
            }

            //Analyze and stem all the words from start or just use the created stems
            var wordStemMap = createStemMapFile ? CreateStemMapFile() : Stems.FromDictionary(StemMapPath);

            Console.WriteLine(@"Stem Map Constructed: " + sw.Elapsed);

            if (generateDictionary)
            {
                DictionaryGenerator.Generate(wordStemMap, DictDirectoryPath + "tr-TR", langCode: "tr-TR");
                Console.WriteLine(@"Dictionary Generated: " + sw.Elapsed);
            }

            if (runTests)
            {
                HunspellHelper.RunTests();
            }
        }
Example #2
0
        private static void GenerateTestDictionary()
        {
            var map = Stems.FromDictionary(DataDir + "stemMapTest.txt");

            DictionaryGenerator.Generate(map, DictDirectoryPath + @"test", "test");
        }