nlptoolkit-morphologicalanalysis 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +144 -0
- package/dist/Corpus/DisambiguatedWord.d.ts +20 -0
- package/dist/Corpus/DisambiguatedWord.js +38 -0
- package/dist/Corpus/DisambiguatedWord.js.map +1 -0
- package/dist/Corpus/DisambiguationCorpus.d.ts +4 -0
- package/dist/Corpus/DisambiguationCorpus.js +54 -0
- package/dist/Corpus/DisambiguationCorpus.js.map +1 -0
- package/dist/MorphologicalAnalysis/FiniteStateMachine.d.ts +63 -0
- package/dist/MorphologicalAnalysis/FiniteStateMachine.js +178 -0
- package/dist/MorphologicalAnalysis/FiniteStateMachine.js.map +1 -0
- package/dist/MorphologicalAnalysis/FsmMorphologicalAnalyzer.d.ts +399 -0
- package/dist/MorphologicalAnalysis/FsmMorphologicalAnalyzer.js +1255 -0
- package/dist/MorphologicalAnalysis/FsmMorphologicalAnalyzer.js.map +1 -0
- package/dist/MorphologicalAnalysis/FsmParse.d.ts +290 -0
- package/dist/MorphologicalAnalysis/FsmParse.js +684 -0
- package/dist/MorphologicalAnalysis/FsmParse.js.map +1 -0
- package/dist/MorphologicalAnalysis/FsmParseList.d.ts +96 -0
- package/dist/MorphologicalAnalysis/FsmParseList.js +242 -0
- package/dist/MorphologicalAnalysis/FsmParseList.js.map +1 -0
- package/dist/MorphologicalAnalysis/InflectionalGroup.d.ts +77 -0
- package/dist/MorphologicalAnalysis/InflectionalGroup.js +213 -0
- package/dist/MorphologicalAnalysis/InflectionalGroup.js.map +1 -0
- package/dist/MorphologicalAnalysis/MetamorphicParse.d.ts +63 -0
- package/dist/MorphologicalAnalysis/MetamorphicParse.js +592 -0
- package/dist/MorphologicalAnalysis/MetamorphicParse.js.map +1 -0
- package/dist/MorphologicalAnalysis/MorphologicalParse.d.ts +301 -0
- package/dist/MorphologicalAnalysis/MorphologicalParse.js +969 -0
- package/dist/MorphologicalAnalysis/MorphologicalParse.js.map +1 -0
- package/dist/MorphologicalAnalysis/MorphologicalTag.d.ts +510 -0
- package/dist/MorphologicalAnalysis/MorphologicalTag.js +525 -0
- package/dist/MorphologicalAnalysis/MorphologicalTag.js.map +1 -0
- package/dist/MorphologicalAnalysis/State.d.ts +40 -0
- package/dist/MorphologicalAnalysis/State.js +64 -0
- package/dist/MorphologicalAnalysis/State.js.map +1 -0
- package/dist/MorphologicalAnalysis/Transition.d.ts +159 -0
- package/dist/MorphologicalAnalysis/Transition.js +751 -0
- package/dist/MorphologicalAnalysis/Transition.js.map +1 -0
- package/index.js +12 -0
- package/package.json +30 -0
- package/penntreebank.txt +208431 -0
- package/source/Corpus/DisambiguatedWord.ts +29 -0
- package/source/Corpus/DisambiguationCorpus.ts +39 -0
- package/source/MorphologicalAnalysis/FiniteStateMachine.ts +165 -0
- package/source/MorphologicalAnalysis/FsmMorphologicalAnalyzer.ts +1256 -0
- package/source/MorphologicalAnalysis/FsmParse.ts +664 -0
- package/source/MorphologicalAnalysis/FsmParseList.ts +238 -0
- package/source/MorphologicalAnalysis/InflectionalGroup.ts +210 -0
- package/source/MorphologicalAnalysis/MetamorphicParse.ts +589 -0
- package/source/MorphologicalAnalysis/MorphologicalParse.ts +995 -0
- package/source/MorphologicalAnalysis/MorphologicalTag.ts +510 -0
- package/source/MorphologicalAnalysis/State.ts +59 -0
- package/source/MorphologicalAnalysis/Transition.ts +733 -0
- package/source/tsconfig.json +13 -0
- package/tests/DisambiguationCorpusTest.ts +12 -0
- package/tests/FiniteStateMachineTest.ts +87 -0
- package/tests/FsmMorphologicalAnalyzerTest.ts +204 -0
- package/tests/FsmParseListTest.ts +90 -0
- package/tests/FsmParseTest.ts +66 -0
- package/tests/InflectionalGroupTest.ts +84 -0
- package/tests/MorphologicalParseTest.ts +152 -0
- package/tests/TransitionTest.ts +174 -0
- package/tsconfig.json +15 -0
- package/turkish_dictionary.txt +62120 -0
- package/turkish_finite_state_machine.xml +1887 -0
- package/turkish_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
3
|
+
export declare class FsmParseList {
|
|
4
|
+
private readonly fsmParses;
|
|
5
|
+
/**
|
|
6
|
+
* A constructor of {@link FsmParseList} class which takes an {@link Array} fsmParses as an input. First it sorts
|
|
7
|
+
* the items of the {@link Array} then loops through it, if the current item's transitions equal to the next item's
|
|
8
|
+
* transitions, it removes the latter item. At the end, it assigns this {@link Array} to the fsmParses variable.
|
|
9
|
+
*
|
|
10
|
+
* @param fsmParses {@link FsmParse} type{@link Array} input.
|
|
11
|
+
*/
|
|
12
|
+
constructor(fsmParses: Array<FsmParse>);
|
|
13
|
+
/**
|
|
14
|
+
* The size method returns the size of fsmParses {@link Array}.
|
|
15
|
+
*
|
|
16
|
+
* @return the size of fsmParses {@link Array}.
|
|
17
|
+
*/
|
|
18
|
+
size(): number;
|
|
19
|
+
/**
|
|
20
|
+
* The getFsmParse method takes an integer index as an input and returns the item of fsmParses {@link Array} at
|
|
21
|
+
* given index.
|
|
22
|
+
*
|
|
23
|
+
* @param index Integer input.
|
|
24
|
+
* @return the item of fsmParses {@link Array} at given index.
|
|
25
|
+
*/
|
|
26
|
+
getFsmParse(index: number): FsmParse;
|
|
27
|
+
/**
|
|
28
|
+
* The rootWords method gets the first item's root of fsmParses {@link Array} and uses it as currentRoot. Then loops
|
|
29
|
+
* through the fsmParses, if the current item's root does not equal to the currentRoot, it then assigns it as the
|
|
30
|
+
* currentRoot and accumulates root words in a {@link String} result.
|
|
31
|
+
*
|
|
32
|
+
* @return String result that has root words.
|
|
33
|
+
*/
|
|
34
|
+
rootWords(): string;
|
|
35
|
+
/**
|
|
36
|
+
* The reduceToParsesWithSameRootAndPos method takes a {@link Word} currentWithPos as an input and loops i times till
|
|
37
|
+
* i equals to the size of the fsmParses {@link Array}. If the given currentWithPos does not equal to the ith item's
|
|
38
|
+
* root and the MorphologicalTag of the first inflectional of fsmParses, it removes the ith item from the {@link Array}.
|
|
39
|
+
*
|
|
40
|
+
* @param currentWithPos {@link Word} input.
|
|
41
|
+
*/
|
|
42
|
+
reduceToParsesWithSameRootAndPos(currentWithPos: Word): void;
|
|
43
|
+
/**
|
|
44
|
+
* The getParseWithLongestRootWord method returns the parse with the longest root word. If more than one parse has the
|
|
45
|
+
* longest root word, the first parse with that root is returned.
|
|
46
|
+
*
|
|
47
|
+
* @return FsmParse Parse with the longest root word.
|
|
48
|
+
*/
|
|
49
|
+
getParseWithLongestRootWord(): FsmParse;
|
|
50
|
+
/**
|
|
51
|
+
* The reduceToParsesWithSameRoot method takes a {@link String} currentWithPos as an input and loops i times till
|
|
52
|
+
* i equals to the size of the fsmParses {@link Array}. If the given currentRoot does not equal to the root of ith
|
|
53
|
+
* item of fsmParses, it removes the ith item from the {@link Array}.
|
|
54
|
+
*
|
|
55
|
+
* @param currentRoot {@link String} input.
|
|
56
|
+
*/
|
|
57
|
+
reduceToParsesWithSameRoot(currentRoot: string): void;
|
|
58
|
+
/**
|
|
59
|
+
* The constructParseListForDifferentRootWithPos method initially creates a result {@link Array} then loops through the
|
|
60
|
+
* fsmParses {@link Array}. For the first iteration, it creates new {@link Array} as initial, then adds the
|
|
61
|
+
* first item od fsmParses to initial and also add this initial {@link Array} to the result {@link Array}.
|
|
62
|
+
* For the following iterations, it checks whether the current item's root with the MorphologicalTag of the first inflectional
|
|
63
|
+
* equal to the previous item's root with the MorphologicalTag of the first inflectional. If so, it adds that item
|
|
64
|
+
* to the result {@link Array}, if not it creates new {@link Array} as initial and adds the first item od fsmParses
|
|
65
|
+
* to initial and also add this initial {@link Array} to the result {@link Array}.
|
|
66
|
+
*
|
|
67
|
+
* @return result {@link Array} type of {@link FsmParseList}.
|
|
68
|
+
*/
|
|
69
|
+
constructParseListForDifferentRootWithPos(): Array<FsmParseList>;
|
|
70
|
+
/**
|
|
71
|
+
* The parsesWithoutPrefixAndSuffix method first creates a {@link String} array named analyses with the size of
|
|
72
|
+
* fsmParses {@link Array}'s size.
|
|
73
|
+
* <p>
|
|
74
|
+
* If the size is just 1, it then returns the first item's transitionList, if it is greater than 1, loops through
|
|
75
|
+
* the fsmParses and puts the transitionList of each item to the analyses array.
|
|
76
|
+
* <p>
|
|
77
|
+
* If the removePrefix condition holds, it loops through the analyses array and takes each item's substring after
|
|
78
|
+
* the first + sign and updates that item of analyses array with that substring.
|
|
79
|
+
* <p>
|
|
80
|
+
* If the removeSuffix condition holds, it loops through the analyses array and takes each item's substring till the
|
|
81
|
+
* last + sign and updates that item of analyses array with that substring.
|
|
82
|
+
* <p>
|
|
83
|
+
* It then removes the duplicate items of analyses array and returns a result {@link String} that has the
|
|
84
|
+
* accumulated items of analyses array.
|
|
85
|
+
*
|
|
86
|
+
* @return result {@link String} that has the accumulated items of analyses array.
|
|
87
|
+
*/
|
|
88
|
+
parsesWithoutPrefixAndSuffix(): string;
|
|
89
|
+
/**
|
|
90
|
+
* The overridden toString method loops through the fsmParses {@link Array} and accumulates the items to a result
|
|
91
|
+
* {@link String}.
|
|
92
|
+
*
|
|
93
|
+
* @return result {@link String} that has the items of fsmParses {@link Array}.
|
|
94
|
+
*/
|
|
95
|
+
toString(): string;
|
|
96
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FsmParseList = void 0;
|
|
13
|
+
class FsmParseList {
|
|
14
|
+
/**
|
|
15
|
+
* A constructor of {@link FsmParseList} class which takes an {@link Array} fsmParses as an input. First it sorts
|
|
16
|
+
* the items of the {@link Array} then loops through it, if the current item's transitions equal to the next item's
|
|
17
|
+
* transitions, it removes the latter item. At the end, it assigns this {@link Array} to the fsmParses variable.
|
|
18
|
+
*
|
|
19
|
+
* @param fsmParses {@link FsmParse} type{@link Array} input.
|
|
20
|
+
*/
|
|
21
|
+
constructor(fsmParses) {
|
|
22
|
+
this.fsmParses = new Array();
|
|
23
|
+
fsmParses.sort((fsmParse1, fsmParse2) => fsmParse1.getFsmParseTransitionList().localeCompare(fsmParse2.getFsmParseTransitionList()));
|
|
24
|
+
for (let i = 0; i < fsmParses.length - 1; i++) {
|
|
25
|
+
if (fsmParses[i].getFsmParseTransitionList() == fsmParses[i + 1].getFsmParseTransitionList()) {
|
|
26
|
+
fsmParses.splice(i + 1, 1);
|
|
27
|
+
i--;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
this.fsmParses = fsmParses;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The size method returns the size of fsmParses {@link Array}.
|
|
34
|
+
*
|
|
35
|
+
* @return the size of fsmParses {@link Array}.
|
|
36
|
+
*/
|
|
37
|
+
size() {
|
|
38
|
+
return this.fsmParses.length;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The getFsmParse method takes an integer index as an input and returns the item of fsmParses {@link Array} at
|
|
42
|
+
* given index.
|
|
43
|
+
*
|
|
44
|
+
* @param index Integer input.
|
|
45
|
+
* @return the item of fsmParses {@link Array} at given index.
|
|
46
|
+
*/
|
|
47
|
+
getFsmParse(index) {
|
|
48
|
+
return this.fsmParses[index];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The rootWords method gets the first item's root of fsmParses {@link Array} and uses it as currentRoot. Then loops
|
|
52
|
+
* through the fsmParses, if the current item's root does not equal to the currentRoot, it then assigns it as the
|
|
53
|
+
* currentRoot and accumulates root words in a {@link String} result.
|
|
54
|
+
*
|
|
55
|
+
* @return String result that has root words.
|
|
56
|
+
*/
|
|
57
|
+
rootWords() {
|
|
58
|
+
let result = this.fsmParses[0].getWord().getName(), currentRoot = result;
|
|
59
|
+
for (let i = 1; i < this.fsmParses.length; i++) {
|
|
60
|
+
if (this.fsmParses[i].getWord().getName() != currentRoot) {
|
|
61
|
+
currentRoot = this.fsmParses[i].getWord().getName();
|
|
62
|
+
result = result + "$" + currentRoot;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The reduceToParsesWithSameRootAndPos method takes a {@link Word} currentWithPos as an input and loops i times till
|
|
69
|
+
* i equals to the size of the fsmParses {@link Array}. If the given currentWithPos does not equal to the ith item's
|
|
70
|
+
* root and the MorphologicalTag of the first inflectional of fsmParses, it removes the ith item from the {@link Array}.
|
|
71
|
+
*
|
|
72
|
+
* @param currentWithPos {@link Word} input.
|
|
73
|
+
*/
|
|
74
|
+
reduceToParsesWithSameRootAndPos(currentWithPos) {
|
|
75
|
+
let i = 0;
|
|
76
|
+
while (i < this.fsmParses.length) {
|
|
77
|
+
if (this.fsmParses[i].getWordWithPos().getName() != currentWithPos.getName()) {
|
|
78
|
+
this.fsmParses.splice(i, 1);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
i++;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The getParseWithLongestRootWord method returns the parse with the longest root word. If more than one parse has the
|
|
87
|
+
* longest root word, the first parse with that root is returned.
|
|
88
|
+
*
|
|
89
|
+
* @return FsmParse Parse with the longest root word.
|
|
90
|
+
*/
|
|
91
|
+
getParseWithLongestRootWord() {
|
|
92
|
+
let maxLength = -1;
|
|
93
|
+
let bestParse = undefined;
|
|
94
|
+
for (let currentParse of this.fsmParses) {
|
|
95
|
+
if (currentParse.getWord().getName().length > maxLength) {
|
|
96
|
+
maxLength = currentParse.getWord().getName().length;
|
|
97
|
+
bestParse = currentParse;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return bestParse;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The reduceToParsesWithSameRoot method takes a {@link String} currentWithPos as an input and loops i times till
|
|
104
|
+
* i equals to the size of the fsmParses {@link Array}. If the given currentRoot does not equal to the root of ith
|
|
105
|
+
* item of fsmParses, it removes the ith item from the {@link Array}.
|
|
106
|
+
*
|
|
107
|
+
* @param currentRoot {@link String} input.
|
|
108
|
+
*/
|
|
109
|
+
reduceToParsesWithSameRoot(currentRoot) {
|
|
110
|
+
let i = 0;
|
|
111
|
+
while (i < this.fsmParses.length) {
|
|
112
|
+
if (this.fsmParses[i].getWord().getName() != currentRoot) {
|
|
113
|
+
this.fsmParses.splice(i, 1);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
i++;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The constructParseListForDifferentRootWithPos method initially creates a result {@link Array} then loops through the
|
|
122
|
+
* fsmParses {@link Array}. For the first iteration, it creates new {@link Array} as initial, then adds the
|
|
123
|
+
* first item od fsmParses to initial and also add this initial {@link Array} to the result {@link Array}.
|
|
124
|
+
* For the following iterations, it checks whether the current item's root with the MorphologicalTag of the first inflectional
|
|
125
|
+
* equal to the previous item's root with the MorphologicalTag of the first inflectional. If so, it adds that item
|
|
126
|
+
* to the result {@link Array}, if not it creates new {@link Array} as initial and adds the first item od fsmParses
|
|
127
|
+
* to initial and also add this initial {@link Array} to the result {@link Array}.
|
|
128
|
+
*
|
|
129
|
+
* @return result {@link Array} type of {@link FsmParseList}.
|
|
130
|
+
*/
|
|
131
|
+
constructParseListForDifferentRootWithPos() {
|
|
132
|
+
let result = new Array();
|
|
133
|
+
let i = 0;
|
|
134
|
+
while (i < this.fsmParses.length) {
|
|
135
|
+
if (i == 0) {
|
|
136
|
+
let initial = new Array();
|
|
137
|
+
initial.push(this.fsmParses[i]);
|
|
138
|
+
result.push(new FsmParseList(initial));
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
if (this.fsmParses[i].getWordWithPos().getName() == this.fsmParses[i - 1].getWordWithPos().getName()) {
|
|
142
|
+
result[result.length - 1].fsmParses.push(this.fsmParses[i]);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
let initial = new Array();
|
|
146
|
+
initial.push(this.fsmParses[i]);
|
|
147
|
+
result.push(new FsmParseList(initial));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
i++;
|
|
151
|
+
}
|
|
152
|
+
return result;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The parsesWithoutPrefixAndSuffix method first creates a {@link String} array named analyses with the size of
|
|
156
|
+
* fsmParses {@link Array}'s size.
|
|
157
|
+
* <p>
|
|
158
|
+
* If the size is just 1, it then returns the first item's transitionList, if it is greater than 1, loops through
|
|
159
|
+
* the fsmParses and puts the transitionList of each item to the analyses array.
|
|
160
|
+
* <p>
|
|
161
|
+
* If the removePrefix condition holds, it loops through the analyses array and takes each item's substring after
|
|
162
|
+
* the first + sign and updates that item of analyses array with that substring.
|
|
163
|
+
* <p>
|
|
164
|
+
* If the removeSuffix condition holds, it loops through the analyses array and takes each item's substring till the
|
|
165
|
+
* last + sign and updates that item of analyses array with that substring.
|
|
166
|
+
* <p>
|
|
167
|
+
* It then removes the duplicate items of analyses array and returns a result {@link String} that has the
|
|
168
|
+
* accumulated items of analyses array.
|
|
169
|
+
*
|
|
170
|
+
* @return result {@link String} that has the accumulated items of analyses array.
|
|
171
|
+
*/
|
|
172
|
+
parsesWithoutPrefixAndSuffix() {
|
|
173
|
+
let analyses = new Array();
|
|
174
|
+
let removePrefix = true, removeSuffix = true;
|
|
175
|
+
if (this.fsmParses.length == 1) {
|
|
176
|
+
return this.fsmParses[0].getFsmParseTransitionList().substring(this.fsmParses[0].getFsmParseTransitionList().indexOf("+") + 1);
|
|
177
|
+
}
|
|
178
|
+
for (let i = 0; i < this.fsmParses.length; i++) {
|
|
179
|
+
analyses.push(this.fsmParses[i].getFsmParseTransitionList());
|
|
180
|
+
}
|
|
181
|
+
while (removePrefix) {
|
|
182
|
+
removePrefix = true;
|
|
183
|
+
for (let i = 0; i < this.fsmParses.length - 1; i++) {
|
|
184
|
+
if (!analyses[i].includes("+") || !analyses[i + 1].includes("+") ||
|
|
185
|
+
analyses[i].substring(0, analyses[i].indexOf("+") + 1) != analyses[i + 1].substring(0, analyses[i + 1].indexOf("+") + 1)) {
|
|
186
|
+
removePrefix = false;
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (removePrefix) {
|
|
191
|
+
for (let i = 0; i < this.fsmParses.length; i++) {
|
|
192
|
+
analyses[i] = analyses[i].substring(analyses[i].indexOf("+") + 1);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
while (removeSuffix) {
|
|
197
|
+
removeSuffix = true;
|
|
198
|
+
for (let i = 0; i < this.fsmParses.length - 1; i++) {
|
|
199
|
+
if (!analyses[i].includes("+") || !analyses[i + 1].includes("+") ||
|
|
200
|
+
analyses[i].substring(analyses[i].lastIndexOf("+")) != analyses[i + 1].substring(analyses[i + 1].lastIndexOf("+"))) {
|
|
201
|
+
removeSuffix = false;
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (removeSuffix) {
|
|
206
|
+
for (let i = 0; i < this.fsmParses.length; i++) {
|
|
207
|
+
analyses[i] = analyses[i].substring(0, analyses[i].lastIndexOf("+"));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
for (let i = 0; i < analyses.length; i++) {
|
|
212
|
+
for (let j = i + 1; j < analyses.length; j++) {
|
|
213
|
+
if (analyses[i] > analyses[j]) {
|
|
214
|
+
let tmp = analyses[i];
|
|
215
|
+
analyses[i] = analyses[j];
|
|
216
|
+
analyses[j] = tmp;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
let result = analyses[0];
|
|
221
|
+
for (let i = 1; i < analyses.length; i++) {
|
|
222
|
+
result = result + "$" + analyses[i];
|
|
223
|
+
}
|
|
224
|
+
return result;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* The overridden toString method loops through the fsmParses {@link Array} and accumulates the items to a result
|
|
228
|
+
* {@link String}.
|
|
229
|
+
*
|
|
230
|
+
* @return result {@link String} that has the items of fsmParses {@link Array}.
|
|
231
|
+
*/
|
|
232
|
+
toString() {
|
|
233
|
+
let result = "";
|
|
234
|
+
for (let i = 0; i < this.fsmParses.length; i++) {
|
|
235
|
+
result += this.fsmParses[i] + "\n";
|
|
236
|
+
}
|
|
237
|
+
return result;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
exports.FsmParseList = FsmParseList;
|
|
241
|
+
});
|
|
242
|
+
//# sourceMappingURL=FsmParseList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FsmParseList.js","sourceRoot":"","sources":["../../source/MorphologicalAnalysis/FsmParseList.ts"],"names":[],"mappings":";;;;;;;;;;;;IAGA,MAAa,YAAY;QAIrB;;;;;;WAMG;QACH,YAAY,SAA0B;YATrB,cAAS,GAAoB,IAAI,KAAK,EAAY,CAAA;YAU/D,SAAS,CAAC,IAAI,CAAC,CAAC,SAAmB,EAAE,SAAmB,EAAE,EAAE,CACxD,SAAS,CAAC,yBAAyB,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,yBAAyB,EAAE,CAAC,CAAC,CAAA;YAC/F,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;gBAC3C,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,yBAAyB,EAAE,IAAI,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,yBAAyB,EAAE,EAAE;oBAC1F,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;oBAC3B,CAAC,EAAE,CAAC;iBACP;aACJ;YACD,IAAI,CAAC,SAAS,GAAG,SAA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K,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACtC,MAAM,GAAG,MAAM,GAAG,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;aACvC;YACD,OAAO,MAAM,CAAC;QAClB,CAAC;QAED;;;;;WAKG;QACH,QAAQ;YACJ,IAAI,MAAM,GAAG,EAAE,CAAC;YAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC5C,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;aACtC;YACD,OAAO,MAAM,CAAC;QAClB,CAAC;KACJ;IA1OD,oCA0OC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { MorphologicalTag } from "./MorphologicalTag";
|
|
2
|
+
export declare class InflectionalGroup {
|
|
3
|
+
private IG;
|
|
4
|
+
static tags: string[];
|
|
5
|
+
static morphoTags: MorphologicalTag[];
|
|
6
|
+
/**
|
|
7
|
+
* The getMorphologicalTag method takes a String tag as an input and if the input matches with one of the elements of
|
|
8
|
+
* tags array, it then gets the morphoTags of this tag and returns it.
|
|
9
|
+
*
|
|
10
|
+
* @param tag String to get morphoTags from.
|
|
11
|
+
* @return morphoTags if found, null otherwise.
|
|
12
|
+
*/
|
|
13
|
+
static getMorphologicalTag(tag: string): MorphologicalTag;
|
|
14
|
+
/**
|
|
15
|
+
* The getTag method takes a MorphologicalTag type tag as an input and returns its corresponding tag from tags array.
|
|
16
|
+
*
|
|
17
|
+
* @param tag MorphologicalTag type input to find tag from.
|
|
18
|
+
* @return tag if found, null otherwise.
|
|
19
|
+
*/
|
|
20
|
+
static getTag(tag: MorphologicalTag): string;
|
|
21
|
+
/**
|
|
22
|
+
* A constructor of {@link InflectionalGroup} class which initializes the IG {@link Array} by parsing given input
|
|
23
|
+
* String IG by + and calling the getMorphologicalTag method with these substrings. If getMorphologicalTag method returns
|
|
24
|
+
* a tag, it adds this tag to the IG {@link Array}.
|
|
25
|
+
*
|
|
26
|
+
* @param IG String input.
|
|
27
|
+
*/
|
|
28
|
+
constructor(IG: string);
|
|
29
|
+
/**
|
|
30
|
+
* Another getTag method which takes index as an input and returns the corresponding tag from IG {@link ArrayList}.
|
|
31
|
+
*
|
|
32
|
+
* @param index to get tag.
|
|
33
|
+
* @return tag at input index.
|
|
34
|
+
*/
|
|
35
|
+
getTag(index: number): MorphologicalTag;
|
|
36
|
+
/**
|
|
37
|
+
* The size method returns the size of the IG {@link Array}.
|
|
38
|
+
*
|
|
39
|
+
* @return the size of the IG {@link Array}.
|
|
40
|
+
*/
|
|
41
|
+
size(): number;
|
|
42
|
+
/**
|
|
43
|
+
* Overridden toString method to return resulting tags in IG {@link Array}.
|
|
44
|
+
*
|
|
45
|
+
* @return String result.
|
|
46
|
+
*/
|
|
47
|
+
toString(): string;
|
|
48
|
+
/**
|
|
49
|
+
* The containsCase method loops through the tags in IG {@link Array} and finds out the tags of the NOMINATIVE,
|
|
50
|
+
* ACCUSATIVE, DATIVE, LOCATIVE or ABLATIVE cases.
|
|
51
|
+
*
|
|
52
|
+
* @return tag which holds the condition.
|
|
53
|
+
*/
|
|
54
|
+
containsCase(): MorphologicalTag;
|
|
55
|
+
/**
|
|
56
|
+
* The containsPlural method loops through the tags in IG {@link Array} and checks whether the tags are from
|
|
57
|
+
* the agreement plural or possessive plural, i.e A1PL, A2PL, A3PL, P1PL, P2PL and P3PL.
|
|
58
|
+
*
|
|
59
|
+
* @return true if the tag is plural, false otherwise.
|
|
60
|
+
*/
|
|
61
|
+
containsPlural(): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* The containsTag method takes a MorphologicalTag type tag as an input and loops through the tags in
|
|
64
|
+
* IG {@link Array} and returns true if the input matches with on of the tags in the IG.
|
|
65
|
+
*
|
|
66
|
+
* @param tag MorphologicalTag type input to search for.
|
|
67
|
+
* @return true if tag matches with the tag in IG, false otherwise.
|
|
68
|
+
*/
|
|
69
|
+
containsTag(tag: MorphologicalTag): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* The containsPossessive method loops through the tags in IG {@link Array} and returns true if the tag in IG is
|
|
72
|
+
* one of the possessives: P1PL, P1SG, P2PL, P2SG, P3PL AND P3SG.
|
|
73
|
+
*
|
|
74
|
+
* @return true if it contains possessive tag, false otherwise.
|
|
75
|
+
*/
|
|
76
|
+
containsPossessive(): boolean;
|
|
77
|
+
}
|