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.
Files changed (65) hide show
  1. package/README.md +144 -0
  2. package/dist/Corpus/DisambiguatedWord.d.ts +20 -0
  3. package/dist/Corpus/DisambiguatedWord.js +38 -0
  4. package/dist/Corpus/DisambiguatedWord.js.map +1 -0
  5. package/dist/Corpus/DisambiguationCorpus.d.ts +4 -0
  6. package/dist/Corpus/DisambiguationCorpus.js +54 -0
  7. package/dist/Corpus/DisambiguationCorpus.js.map +1 -0
  8. package/dist/MorphologicalAnalysis/FiniteStateMachine.d.ts +63 -0
  9. package/dist/MorphologicalAnalysis/FiniteStateMachine.js +178 -0
  10. package/dist/MorphologicalAnalysis/FiniteStateMachine.js.map +1 -0
  11. package/dist/MorphologicalAnalysis/FsmMorphologicalAnalyzer.d.ts +399 -0
  12. package/dist/MorphologicalAnalysis/FsmMorphologicalAnalyzer.js +1255 -0
  13. package/dist/MorphologicalAnalysis/FsmMorphologicalAnalyzer.js.map +1 -0
  14. package/dist/MorphologicalAnalysis/FsmParse.d.ts +290 -0
  15. package/dist/MorphologicalAnalysis/FsmParse.js +684 -0
  16. package/dist/MorphologicalAnalysis/FsmParse.js.map +1 -0
  17. package/dist/MorphologicalAnalysis/FsmParseList.d.ts +96 -0
  18. package/dist/MorphologicalAnalysis/FsmParseList.js +242 -0
  19. package/dist/MorphologicalAnalysis/FsmParseList.js.map +1 -0
  20. package/dist/MorphologicalAnalysis/InflectionalGroup.d.ts +77 -0
  21. package/dist/MorphologicalAnalysis/InflectionalGroup.js +213 -0
  22. package/dist/MorphologicalAnalysis/InflectionalGroup.js.map +1 -0
  23. package/dist/MorphologicalAnalysis/MetamorphicParse.d.ts +63 -0
  24. package/dist/MorphologicalAnalysis/MetamorphicParse.js +592 -0
  25. package/dist/MorphologicalAnalysis/MetamorphicParse.js.map +1 -0
  26. package/dist/MorphologicalAnalysis/MorphologicalParse.d.ts +301 -0
  27. package/dist/MorphologicalAnalysis/MorphologicalParse.js +969 -0
  28. package/dist/MorphologicalAnalysis/MorphologicalParse.js.map +1 -0
  29. package/dist/MorphologicalAnalysis/MorphologicalTag.d.ts +510 -0
  30. package/dist/MorphologicalAnalysis/MorphologicalTag.js +525 -0
  31. package/dist/MorphologicalAnalysis/MorphologicalTag.js.map +1 -0
  32. package/dist/MorphologicalAnalysis/State.d.ts +40 -0
  33. package/dist/MorphologicalAnalysis/State.js +64 -0
  34. package/dist/MorphologicalAnalysis/State.js.map +1 -0
  35. package/dist/MorphologicalAnalysis/Transition.d.ts +159 -0
  36. package/dist/MorphologicalAnalysis/Transition.js +751 -0
  37. package/dist/MorphologicalAnalysis/Transition.js.map +1 -0
  38. package/index.js +12 -0
  39. package/package.json +30 -0
  40. package/penntreebank.txt +208431 -0
  41. package/source/Corpus/DisambiguatedWord.ts +29 -0
  42. package/source/Corpus/DisambiguationCorpus.ts +39 -0
  43. package/source/MorphologicalAnalysis/FiniteStateMachine.ts +165 -0
  44. package/source/MorphologicalAnalysis/FsmMorphologicalAnalyzer.ts +1256 -0
  45. package/source/MorphologicalAnalysis/FsmParse.ts +664 -0
  46. package/source/MorphologicalAnalysis/FsmParseList.ts +238 -0
  47. package/source/MorphologicalAnalysis/InflectionalGroup.ts +210 -0
  48. package/source/MorphologicalAnalysis/MetamorphicParse.ts +589 -0
  49. package/source/MorphologicalAnalysis/MorphologicalParse.ts +995 -0
  50. package/source/MorphologicalAnalysis/MorphologicalTag.ts +510 -0
  51. package/source/MorphologicalAnalysis/State.ts +59 -0
  52. package/source/MorphologicalAnalysis/Transition.ts +733 -0
  53. package/source/tsconfig.json +13 -0
  54. package/tests/DisambiguationCorpusTest.ts +12 -0
  55. package/tests/FiniteStateMachineTest.ts +87 -0
  56. package/tests/FsmMorphologicalAnalyzerTest.ts +204 -0
  57. package/tests/FsmParseListTest.ts +90 -0
  58. package/tests/FsmParseTest.ts +66 -0
  59. package/tests/InflectionalGroupTest.ts +84 -0
  60. package/tests/MorphologicalParseTest.ts +152 -0
  61. package/tests/TransitionTest.ts +174 -0
  62. package/tsconfig.json +15 -0
  63. package/turkish_dictionary.txt +62120 -0
  64. package/turkish_finite_state_machine.xml +1887 -0
  65. package/turkish_misspellings.txt +148932 -0
@@ -0,0 +1,399 @@
1
+ import { FiniteStateMachine } from "./FiniteStateMachine";
2
+ import { TxtDictionary } from "nlptoolkit-dictionary/dist/Dictionary/TxtDictionary";
3
+ import { FsmParseList } from "./FsmParseList";
4
+ import { MorphologicalParse } from "./MorphologicalParse";
5
+ import { MetamorphicParse } from "./MetamorphicParse";
6
+ import { TxtWord } from "nlptoolkit-dictionary/dist/Dictionary/TxtWord";
7
+ import { FsmParse } from "./FsmParse";
8
+ import { Sentence } from "nlptoolkit-corpus/dist/Sentence";
9
+ export declare class FsmMorphologicalAnalyzer {
10
+ private dictionaryTrie;
11
+ private parsedSurfaceForms;
12
+ private finiteStateMachine;
13
+ private static MAX_DISTANCE;
14
+ private dictionary;
15
+ private cache;
16
+ private mostUsedPatterns;
17
+ /**
18
+ * Another constructor of FsmMorphologicalAnalyzer class. It generates a new TxtDictionary type dictionary from
19
+ * given input dictionary, with given inputs fileName and cacheSize.
20
+ *
21
+ * @param fileName the file to read the finite state machine.
22
+ * @param dictionaryFileNameOrDictionary the dictionary file that will be used to generate dictionaryTrie.
23
+ * @param cacheSize the size of the LRUCache.
24
+ */
25
+ constructor(fileName?: string, dictionaryFileNameOrDictionary?: any, cacheSize?: number);
26
+ addParsedSurfaceForms(fileName: string): void;
27
+ /**
28
+ * The getPossibleWords method takes {@link MorphologicalParse} and {@link MetamorphicParse} as input.
29
+ * First it determines whether the given morphologicalParse is the root verb and whether it contains a verb tag.
30
+ * Then it creates new transition with -mak and creates a new {@link Set} result.
31
+ * <p>
32
+ * It takes the given {@link MetamorphicParse} input as currentWord and if there is a compound word starting with the
33
+ * currentWord, it gets this compoundWord from dictionaryTrie. If there is a compoundWord and the difference of the
34
+ * currentWord and compundWords is less than 3 than compoundWord is added to the result, otherwise currentWord is added.
35
+ * <p>
36
+ * Then it gets the root from parse input as a currentRoot. If it is not null, and morphologicalParse input is verb,
37
+ * it directly adds the verb to result after making transition to currentRoot with currentWord String. Else, it creates a new
38
+ * transition with -lar and make this transition then adds to the result.
39
+ *
40
+ * @param morphologicalParse {@link MorphologicalParse} type input.
41
+ * @param metamorphicParse {@link MetamorphicParse} type input.
42
+ * @return {@link HashSet} result.
43
+ */
44
+ getPossibleWords(morphologicalParse: MorphologicalParse, metamorphicParse?: MetamorphicParse): Set<string>;
45
+ /**
46
+ * The getDictionary method is used to get TxtDictionary.
47
+ *
48
+ * @return TxtDictionary type dictionary.
49
+ */
50
+ getDictionary(): TxtDictionary;
51
+ /**
52
+ * The getFiniteStateMachine method is used to get FiniteStateMachine.
53
+ *
54
+ * @return FiniteStateMachine type finiteStateMachine.
55
+ */
56
+ getFiniteStateMachine(): FiniteStateMachine;
57
+ /**
58
+ * The isPossibleSubstring method first checks whether given short and long strings are equal to root word.
59
+ * Then, compares both short and long strings' chars till the last two chars of short string. In the presence of mismatch,
60
+ * false is returned. On the other hand, it counts the distance between two strings until it becomes greater than 2,
61
+ * which is the MAX_DISTANCE also finds the index of the last char.
62
+ * <p>
63
+ * If the substring is a rootWord and equals to 'ben', which is a special case or root holds the lastIdropsDuringSuffixation or
64
+ * lastIdropsDuringPassiveSuffixation conditions, then it returns true if distance is not greater than MAX_DISTANCE.
65
+ * <p>
66
+ * On the other hand, if the shortStrong ends with one of these chars 'e, a, p, ç, t, k' and 't 's a rootWord with
67
+ * the conditions of rootSoftenDuringSuffixation, vowelEChangesToIDuringYSuffixation, vowelAChangesToIDuringYSuffixation
68
+ * or endingKChangesIntoG then it returns true if the last index is not equal to 2 and distance is not greater than
69
+ * MAX_DISTANCE and false otherwise.
70
+ *
71
+ * @param shortString the possible substring.
72
+ * @param longString the long string to compare with substring.
73
+ * @param root the root of the long string.
74
+ * @return true if given substring is the actual substring of the longString, false otherwise.
75
+ */
76
+ private isPossibleSubstring;
77
+ /**
78
+ * The initializeParseList method initializes the given given fsm ArrayList with given root words by parsing them.
79
+ * <p>
80
+ * It checks many conditions;
81
+ * isPlural; if root holds the condition then it gets the state with the name of NominalRootPlural, then
82
+ * creates a new parsing and adds this to the input fsmParse Arraylist.
83
+ * Ex : Açıktohumlular
84
+ * <p>
85
+ * !isPlural and isPortmanteauEndingWithSI, if root holds the conditions then it gets the state with the
86
+ * name of NominalRootNoPossesive.
87
+ * Ex : Balarısı
88
+ * <p>
89
+ * !isPlural and isPortmanteau, if root holds the conditions then it gets the state with the name of
90
+ * CompoundNounRoot.
91
+ * Ex : Aslanağızı
92
+ * <p>
93
+ * !isPlural, !isPortmanteau and isHeader, if root holds the conditions then it gets the state with the
94
+ * name of HeaderRoot.
95
+ * Ex : </title>
96
+ * <p>
97
+ * !isPlural, !isPortmanteau and isInterjection, if root holds the conditions then it gets the state
98
+ * with the name of InterjectionRoot.
99
+ * Ex : Hey, Aa
100
+ * <p>
101
+ * !isPlural, !isPortmanteau and isDuplicate, if root holds the conditions then it gets the state
102
+ * with the name of DuplicateRoot.
103
+ * Ex : Allak,
104
+ * <p>
105
+ * !isPlural, !isPortmanteau and isNumeral, if root holds the conditions then it gets the state
106
+ * with the name of CardinalRoot.
107
+ * Ex : Yüz, bin
108
+ * <p>
109
+ * !isPlural, !isPortmanteau and isReal, if root holds the conditions then it gets the state
110
+ * with the name of RealRoot.
111
+ * Ex : 1.2
112
+ * <p>
113
+ * !isPlural, !isPortmanteau and isFraction, if root holds the conditions then it gets the state
114
+ * with the name of FractionRoot.
115
+ * Ex : 1/2
116
+ * <p>
117
+ * !isPlural, !isPortmanteau and isDate, if root holds the conditions then it gets the state
118
+ * with the name of DateRoot.
119
+ * Ex : 11/06/2018
120
+ * <p>
121
+ * !isPlural, !isPortmanteau and isPercent, if root holds the conditions then it gets the state
122
+ * with the name of PercentRoot.
123
+ * Ex : %12.5
124
+ * <p>
125
+ * !isPlural, !isPortmanteau and isRange, if root holds the conditions then it gets the state
126
+ * with the name of RangeRoot.
127
+ * Ex : 3-5
128
+ * <p>
129
+ * !isPlural, !isPortmanteau and isTime, if root holds the conditions then it gets the state
130
+ * with the name of TimeRoot.
131
+ * Ex : 13:16:08
132
+ * <p>
133
+ * !isPlural, !isPortmanteau and isOrdinal, if root holds the conditions then it gets the state
134
+ * with the name of OrdinalRoot.
135
+ * Ex : Altıncı
136
+ * <p>
137
+ * !isPlural, !isPortmanteau, and isVerb if root holds the conditions then it gets the state
138
+ * with the name of VerbalRoot. Or isPassive, then it gets the state with the name of PassiveHn.
139
+ * Ex : Anla (!isPAssive)
140
+ * Ex : Çağrıl (isPassive)
141
+ * <p>
142
+ * !isPlural, !isPortmanteau and isPronoun, if root holds the conditions then it gets the state
143
+ * with the name of PronounRoot. There are 6 different Pronoun state names, REFLEX, QUANT, QUANTPLURAL, DEMONS, PERS, QUES.
144
+ * REFLEX = Reflexive Pronouns Ex : kendi
145
+ * QUANT = Quantitative Pronouns Ex : öbür, hep, kimse, hiçbiri, bazı, kimi, biri
146
+ * QUANTPLURAL = Quantitative Plural Pronouns Ex : tümü, çoğu, hepsi
147
+ * DEMONS = Demonstrative Pronouns Ex : o, bu, şu
148
+ * PERS = Personal Pronouns Ex : ben, sen, o, biz, siz, onlar
149
+ * QUES = Interrogatıve Pronouns Ex : nere, ne, kim, hangi
150
+ * <p>
151
+ * !isPlural, !isPortmanteau and isAdjective, if root holds the conditions then it gets the state
152
+ * with the name of AdjectiveRoot.
153
+ * Ex : Absürt, Abes
154
+ * <p>
155
+ * !isPlural, !isPortmanteau and isPureAdjective, if root holds the conditions then it gets the state
156
+ * with the name of Adjective.
157
+ * Ex : Geçmiş, Cam
158
+ * <p>
159
+ * !isPlural, !isPortmanteau and isNominal, if root holds the conditions then it gets the state
160
+ * with the name of NominalRoot.
161
+ * Ex : Görüş
162
+ * <p>
163
+ * !isPlural, !isPortmanteau and isProper, if root holds the conditions then it gets the state
164
+ * with the name of ProperRoot.
165
+ * Ex : Abdi
166
+ * <p>
167
+ * !isPlural, !isPortmanteau and isQuestion, if root holds the conditions then it gets the state
168
+ * with the name of QuestionRoot.
169
+ * Ex : Mi, mü
170
+ * <p>
171
+ * !isPlural, !isPortmanteau and isDeterminer, if root holds the conditions then it gets the state
172
+ * with the name of DeterminerRoot.
173
+ * Ex : Çok, bir
174
+ * <p>
175
+ * !isPlural, !isPortmanteau and isConjunction, if root holds the conditions then it gets the state
176
+ * with the name of ConjunctionRoot.
177
+ * Ex : Ama , ancak
178
+ * <p>
179
+ * !isPlural, !isPortmanteau and isPostP, if root holds the conditions then it gets the state
180
+ * with the name of PostP.
181
+ * Ex : Ait, dair
182
+ * <p>
183
+ * !isPlural, !isPortmanteau and isAdverb, if root holds the conditions then it gets the state
184
+ * with the name of AdverbRoot.
185
+ * Ex : Acilen
186
+ *
187
+ * @param fsmParse ArrayList to initialize.
188
+ * @param root word to check properties and add to fsmParse according to them.
189
+ * @param isProper is used to check a word is proper or not.
190
+ */
191
+ private initializeParseList;
192
+ /**
193
+ * The initializeParseListFromRoot method is used to create an {@link Array} which consists of initial fsm parsings.
194
+ * First, traverses this HashSet and uses each word as a root and calls initializeParseList method with this root
195
+ * and Array.
196
+ * <p>
197
+ *
198
+ * @param parseList ArrayList to initialize.
199
+ * @param root the root form to generate initial parse list.
200
+ * @param isProper is used to check a word is proper or not.
201
+ */
202
+ private initializeParseListFromRoot;
203
+ /**
204
+ * The initializeParseListFromSurfaceForm method is used to create an {@link Array} which consists of initial fsm parsings. First,
205
+ * it calls getWordsWithPrefix methods by using input String surfaceForm and generates a {@link Set}. Then, traverses
206
+ * this HashSet and uses each word as a root and calls initializeParseListFromRoot method with this root and ArrayList.
207
+ * <p>
208
+ *
209
+ * @param surfaceForm the String used to generate a HashSet of words.
210
+ * @param isProper is used to check a word is proper or not.
211
+ * @return initialFsmParse ArrayList.
212
+ */
213
+ private initializeParseListFromSurfaceForm;
214
+ /**
215
+ * The addNewParsesFromCurrentParse method initially gets the final suffixes from input currentFsmParse called as currentState,
216
+ * and by using the currentState information it gets the new analysis. Then loops through each currentState's transition.
217
+ * If the currentTransition is possible, it makes the transition.
218
+ *
219
+ * @param currentFsmParse FsmParse type input.
220
+ * @param fsmParse an ArrayList of FsmParse.
221
+ * @param maxLength Maximum length of the parse.
222
+ * @param root TxtWord used to make transition.
223
+ */
224
+ private addNewParsesFromCurrentParseLength;
225
+ /**
226
+ * The addNewParsesFromCurrentParse method initially gets the final suffixes from input currentFsmParse called as currentState,
227
+ * and by using the currentState information it gets the currentSurfaceForm. Then loops through each currentState's transition.
228
+ * If the currentTransition is possible, it makes the transition
229
+ *
230
+ * @param currentFsmParse FsmParse type input.
231
+ * @param fsmParse an ArrayList of FsmParse.
232
+ * @param surfaceForm String to use during transition.
233
+ * @param root TxtWord used to make transition.
234
+ */
235
+ private addNewParsesFromCurrentParseSurfaceForm;
236
+ /**
237
+ * The parseExists method is used to check the existence of the parse.
238
+ *
239
+ * @param fsmParse an ArrayList of FsmParse
240
+ * @param surfaceForm String to use during transition.
241
+ * @return true when the currentState is end state and input surfaceForm id equal to currentSurfaceForm, otherwise false.
242
+ */
243
+ private parseExists;
244
+ /**
245
+ * The parseWord method is used to parse a given fsmParse. It simply adds new parses to the current parse by
246
+ * using addNewParsesFromCurrentParse method.
247
+ *
248
+ * @param fsmParse an ArrayList of FsmParse
249
+ * @param maxLength maximum length of the surfaceform.
250
+ * @return result {@link Array} which has the currentFsmParse.
251
+ */
252
+ private parseWordLength;
253
+ /**
254
+ * The parseWord method is used to parse a given fsmParse. It simply adds new parses to the current parse by
255
+ * using addNewParsesFromCurrentParse method.
256
+ *
257
+ * @param fsmParse an ArrayList of FsmParse
258
+ * @param surfaceForm String to use during transition.
259
+ * @return result {@link Array} which has the currentFsmParse.
260
+ */
261
+ private parseWordSurfaceForm;
262
+ /**
263
+ * The morphologicalAnalysis with 3 inputs is used to initialize an {@link Array} and add a new FsmParse
264
+ * with given root and state.
265
+ *
266
+ * @param root TxtWord input.
267
+ * @param surfaceForm String input to use for parsing.
268
+ * @param state String input.
269
+ * @return parseWord method with newly populated FsmParse ArrayList and input surfaceForm.
270
+ */
271
+ morphologicalAnalysisFromRoot(root: TxtWord, surfaceForm: string, state?: string): Array<FsmParse>;
272
+ distinctSurfaceFormList(parseList: Array<FsmParse>): Set<string>;
273
+ /**
274
+ * The generateAllParses with 2 inputs is used to generate all parses with given root. Then it calls initializeParseListFromRoot method to initialize list with newly created ArrayList, input root,
275
+ * and maximum length.
276
+ *
277
+ * @param root TxtWord input.
278
+ * @param maxLength Maximum length of the surface form.
279
+ * @return parseWord method with newly populated FsmParse ArrayList and maximum length.
280
+ */
281
+ generateAllParses(root: TxtWord, maxLength: number): Array<FsmParse>;
282
+ /**
283
+ * Replaces previous lemma in the sentence with the new lemma. Both lemma can contain multiple words.
284
+ * @param original Original sentence to be replaced with.
285
+ * @param previousWord Root word in the original sentence
286
+ * @param newWord New word to be replaced.
287
+ * @return Newly generated sentence by replacing the previous word in the original sentence with the new word.
288
+ */
289
+ replaceWord(original: Sentence, previousWord: string, newWord: string): Sentence;
290
+ /**
291
+ * The analysisExists method checks several cases. If the given surfaceForm is a punctuation or double then it
292
+ * returns true. If it is not a root word, then it initializes the parse list and returns the parseExists method with
293
+ * this newly initialized list and surfaceForm.
294
+ *
295
+ * @param rootWord TxtWord root.
296
+ * @param surfaceForm String input.
297
+ * @param isProper boolean variable indicates a word is proper or not.
298
+ * @return true if surfaceForm is punctuation or double, otherwise returns parseExist method with given surfaceForm.
299
+ */
300
+ private analysisExists;
301
+ /**
302
+ * The analysis method is used by the morphologicalAnalysis method. It gets String surfaceForm as an input and checks
303
+ * its type such as punctuation, number or compares with the regex for date, fraction, percent, time, range, hashtag,
304
+ * and mail or checks its variable type as integer or double. After finding the right case for given surfaceForm, it calls
305
+ * constructInflectionalGroups method which creates sub-word units.
306
+ *
307
+ * @param surfaceForm String to analyse.
308
+ * @param isProper is used to indicate the proper words.
309
+ * @return ArrayList type initialFsmParse which holds the analyses.
310
+ */
311
+ analysis(surfaceForm: string, isProper: boolean): Array<FsmParse>;
312
+ private patternMatches;
313
+ /**
314
+ * The isProperNoun method takes surfaceForm String as input and checks its each char whether they are in the range
315
+ * of letters between A to Z or one of the Turkish letters such as İ, Ü, Ğ, Ş, Ç, and Ö.
316
+ *
317
+ * @param surfaceForm String to check for proper noun.
318
+ * @return false if surfaceForm is null or length of 0, return true if it is a letter.
319
+ */
320
+ isProperNoun(surfaceForm: string): boolean;
321
+ /**
322
+ * The robustMorphologicalAnalysis is used to analyse surfaceForm String. First it gets the currentParse of the surfaceForm
323
+ * then, if the size of the currentParse is 0, and given surfaceForm is a proper noun, it adds the surfaceForm
324
+ * whose state name is ProperRoot to an {@link Array}, of it is not a proper noon, it adds the surfaceForm
325
+ * whose state name is NominalRoot to the {@link Array}.
326
+ *
327
+ * @param surfaceForm String to analyse.
328
+ * @return FsmParseList type currentParse which holds morphological analysis of the surfaceForm.
329
+ */
330
+ robustMorphologicalAnalysis(surfaceForm: string): FsmParseList;
331
+ /**
332
+ * The morphologicalAnalysis is used for debug purposes.
333
+ *
334
+ * @param sentence to get word from.
335
+ * @return FsmParseList type result.
336
+ */
337
+ morphologicalAnalysisFromSentence(sentence: Sentence): Array<FsmParseList>;
338
+ /**
339
+ * The robustMorphologicalAnalysis method takes just one argument as an input. It gets the name of the words from
340
+ * input sentence then calls robustMorphologicalAnalysis with surfaceForm.
341
+ *
342
+ * @param sentence Sentence type input used to get surfaceForm.
343
+ * @return FsmParseList array which holds the result of the analysis.
344
+ */
345
+ robustMorphologicalAnalysisFromSentence(sentence: Sentence): Array<FsmParseList>;
346
+ /**
347
+ * The isInteger method compares input surfaceForm with regex \+?\d+ and returns the result.
348
+ * Supports positive integer checks only.
349
+ *
350
+ * @param surfaceForm String to check.
351
+ * @return true if surfaceForm matches with the regex.
352
+ */
353
+ private isInteger;
354
+ /**
355
+ * The isDouble method compares input surfaceForm with regex \+?(\d+)?\.\d* and returns the result.
356
+ *
357
+ * @param surfaceForm String to check.
358
+ * @return true if surfaceForm matches with the regex.
359
+ */
360
+ private isDouble;
361
+ /**
362
+ * The isNumber method compares input surfaceForm with the array of written numbers and returns the result.
363
+ *
364
+ * @param surfaceForm String to check.
365
+ * @return true if surfaceForm matches with the regex.
366
+ */
367
+ private isNumber;
368
+ private isPercent;
369
+ private isTime;
370
+ private isRange;
371
+ private isDate;
372
+ /**
373
+ * The morphologicalAnalysis method is used to analyse a FsmParseList by comparing with the regex.
374
+ * It creates an {@link Array} fsmParse to hold the result of the analysis method. For each surfaceForm input,
375
+ * it gets a substring and considers it as a possibleRoot. Then compares with the regex.
376
+ * <p>
377
+ * If the surfaceForm input string matches with Turkish chars like Ç, Ş, İ, Ü, Ö, it adds the surfaceForm to Trie with IS_OA tag.
378
+ * If the possibleRoot contains /, then it is added to the Trie with IS_KESIR tag.
379
+ * If the possibleRoot contains \d\d|\d)/(\d\d|\d)/\d+, then it is added to the Trie with IS_DATE tag.
380
+ * If the possibleRoot contains \\d\d|\d, then it is added to the Trie with IS_PERCENT tag.
381
+ * If the possibleRoot contains \d\d|\d):(\d\d|\d):(\d\d|\d), then it is added to the Trie with IS_ZAMAN tag.
382
+ * If the possibleRoot contains \d+-\d+, then it is added to the Trie with IS_RANGE tag.
383
+ * If the possibleRoot is an Integer, then it is added to the Trie with IS_SAYI tag.
384
+ * If the possibleRoot is a Double, then it is added to the Trie with IS_REELSAYI tag.
385
+ *
386
+ * @param surfaceForm String to analyse.
387
+ * @return fsmParseList which holds the analysis.
388
+ */
389
+ morphologicalAnalysis(surfaceForm: string): FsmParseList;
390
+ /**
391
+ * The morphologicalAnalysisExists method calls analysisExists to check the existence of the analysis with given
392
+ * root and surfaceForm.
393
+ *
394
+ * @param surfaceForm String to check.
395
+ * @param rootWord TxtWord input root.
396
+ * @return true an analysis exists, otherwise return false.
397
+ */
398
+ morphologicalAnalysisExists(rootWord: TxtWord, surfaceForm: string): boolean;
399
+ }