Advertisement
Mikhail-Podbolotov

Untitled

Apr 17th, 2024
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.07 KB | None | 0 0
  1. #include "library.h"
  2. #include <iostream>
  3. #include <fstream>
  4. using namespace std;
  5. int main()
  6. {
  7.     setlocale(LC_ALL, "Russian");
  8.     ifstream file1("text.txt");
  9.     ifstream file3("phraseBeginning.txt");
  10.     ofstream file2("output.txt");
  11.     List Array;
  12.     string Text;
  13.     Text = ReadText(file1);
  14.     Array.CreareList(Text);
  15.     Array.PrintList(file2);
  16.     ListGramm A2, A3;
  17.     Array.FindNGrams(A2, 2);
  18.     Array.FindNGrams(A3, 3);
  19.     cout << "2gramma" << endl;
  20.     A2.PrintNGram(cout);
  21.     cout << "3gramma" << endl;
  22.     A3.PrintNGram(cout);
  23.     string phraseBeginning , t;
  24.     int WordCount = 0;
  25.     file3 >> WordCount;
  26.     getline(file3, t);
  27.     getline(file3, phraseBeginning);
  28.     cout << WordCount << " " << phraseBeginning << endl;
  29.     int k = 0;
  30.     string result = phraseBeginning;
  31.     SearchPhrase(A2, A3, WordCount, phraseBeginning, k, result, cout);
  32.     cout << result << endl;
  33.     /*
  34.     cin >> n;
  35.     Array.FindNGrams(A, n);
  36.     A.PrintNGram(cout);
  37.     cout << "Result: " << endl;
  38.     A.Counting(cout);
  39.     A.PrintNGram(cout);
  40.  
  41.     */
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement