-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformAnalysis.cpp
100 lines (92 loc) · 3.09 KB
/
formAnalysis.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//-----------------------------------------------------------------------
// Source : formAnalysis.cpp
// Last modified : 31.03.2023
// Version : 10
// Description : Determine form of user's word
//-----------------------------------------------------------------------
#include "latin.h"
#include "formAnalysis.h"
using namespace std;
void formAnalysis() {
mainLog.print("= Start of: formAnalysis");
mainLog.print({ "= CR.code: ", intToStr(currentRequest.code,0) });
system("cls");
if (currentRequest.code == menuCode::FORMANALYSIS) {
cout << "Ââåäèòå ñëîâî: ";
while (currentRequest.inputWord() == false) {
cout << "Ñëîâî íàïèñàíî íå íà ëàòûíè, ïîâòîðèòå ââîä\n";
}
}
if (currentRequest.code == menuCode::OUT_FORMANALYSIS) {
cout << currentRequest.word << endl;
if(currentRequest.definition.empty() == false)
cout << currentRequest.definition << endl;
}
while (true) {
ConsoleOutputBlock selectPartOfSpeech("Âûáåðèòå ÷àñòü ðå÷è:", 5,
{ "ñóùåñòâèòåëüíîå","ïðèëàãàòåëüíîå","ãëàãîë" }, { 1,2,3 });
selectPartOfSpeech.print();
switch (selectPartOfSpeech.inputChoice()) {
case 1: {
Noun* mainNoun = new Noun;
delete mainNoun;
break;
}
case 2: {
Adjective* mainAdjective = new Adjective;
delete mainAdjective;
break;
}
case 3: {
Verb* mainVerb = new Verb;
delete mainVerb;
break;
}
default: {
cout << "Âûáðàí íåêîððåêòíûé âàðèàíò, íàæìèòå 1, ÷òîáû èçìåíèòü âûáîð," <<
" èëè ëþáóþ äðóãóþ êëàâèøó, ÷òîáû âåðíóòüñÿ â ìåíþ\n";
char c = _getch();
if (c == '1') {
cout << endl;
continue;
}
else {
mainLog.print("= End of: formAnalysis");
currentRequest.setCode(menuCode::DEFAULT);
return void();
}
}
}
break;
}
cout << endl;
currentRequest.printForms();
char c;
if (currentRequest.forms.empty() == false) {
cout << "\nÍàæìèòå 1, åñëè õîòèòå ñîõðàíèòü ïîëó÷åííûå äàííûå, è ëþáóþ äðóãóþ êëàâèøó, åñëè íåò\n";
c = _getch();
if (c == '1') {
mainOutput.updateWordInfo(-1, currentRequest);
}
}
cout << "\nÄëÿ íîâîãî çàïðîñà íàæìèòå 2\n";
if (currentRequest.definition.empty() == true)
cout << "Äëÿ ïîèñêà îïðåäåëåíèÿ äàííîãî ñëîâà íàæìèòå 4\n";
cout << "Äëÿ âîçâðàùåíèÿ â ìåíþ íàæìèòå ëþáóþ êëàâèøó\n";
c = _getch();
switch (c) {
case '2': {
currentRequest.setCode(menuCode::FORMANALYSIS);
break;
}
case '4': {
currentRequest.setCode(menuCode::OUT_DICTIONARYSEARCH);
break;
}
default: {
currentRequest.setCode(menuCode::DEFAULT);
break;
}
}
mainLog.print("= End of: formAnalysis");
}