public TextProcessor(string txtPath, MorphAn morph) { _morph = morph; StreamReader reader = FileReader.OpenFile(txtPath); _text = FileReader.CreateVirtualText(reader); _wordNav = new SuperNavigator(new WordNavigator()); _sentenceNav = new SuperNavigator(new SentenceNavigator()); _currentSentSegment = new SimpleSegment(-1, 0); _currentWordSegment = new SimpleSegment(-1, 0); }
private static void SetTextAccent(string textName) { MorphAn m = new MorphAn(gramtab, workDir); m.LoadDAWG(); string outDir = Path.Combine(workDir, "TextsOut"); if (!Directory.Exists(outDir)) { Directory.CreateDirectory(outDir); } Directory.SetCurrentDirectory(outDir); TextProcessor p = new TextProcessor(Path.Combine(workDir, textName), m); p.Process(); }
private static void LoadDAWG() { MorphAn m = new MorphAn(gramtab, workDir); m.LoadDAWG(); Console.WriteLine("Calculating statistics..."); m.PrintStat(); // Поиск слов m.PrintLookup("СТАРИНАМИ"); m.PrintLookup("ЭЛЕКТРОПРОВОДА"); m.PrintLookup("ГЛАЗА"); //m.PrintLookup("ЗАМОК"); //m.PrintLookup("ВЕСТИ"); //m.PrintLookup("глокая"); //m.PrintLookup("шпион"); //m.PrintLookup("супершпион"); }