示例#1
0
 private void _openFile_Click(object sender, EventArgs e)
 {
     if (_openFileDialog.ShowDialog() == DialogResult.OK)
     {
         string s = File.ReadAllText(_openFileDialog.FileName);
         _richTextBox.Text = s;
         TokenGenerator tokenGenerator = new TokenGenerator(s);
         _allWords = s.Tokenize();
         RemoveStopWords rsw = new RemoveStopWords(@"e:\магистратура\AutoRef\RusStopWords.txt");
         CountWord.Text = "Количество слов в документе: " + _allWords.Length.ToString();
         // _wordsWithOutStopWords = rsw.Execute(_allWords.ToList());
     }
 }
示例#2
0
 public TokenGenerator(string text)
 {
     _paragraphTokens = new List <ParagraphToken>();
     SentenceCount    = 0;
     WordTokenCount   = 0;
     _numbersList     = new List <string> {
         "1", "2", "3", "4", "5", "6", "7", "8", "9"
     };
     _markerList = new List <string> {
         ":", ": "
     };
     _picturesandtablesList = new List <string> {
         "Рис.", "Taбл."
     };
     BagOfLemm   = new Dictionary <string, WordCounter> {
     };
     _rsw        = new RemoveStopWords(@"e:\магистратура\AutoRef\RusStopWords.txt");
     _rusStemmer = new RusStemmer();
     GenerateParagraphToken(text);
     GenerateSentenceToken();
 }