tinyfix-tr 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +139 -2
- package/dist/pkg/src/context.d.ts +13 -0
- package/dist/pkg/src/context.js +80 -0
- package/dist/pkg/src/data.d.ts +53 -0
- package/dist/pkg/src/data.js +498 -0
- package/dist/pkg/src/engine.d.ts +39 -0
- package/dist/pkg/src/engine.js +357 -0
- package/dist/pkg/src/index.d.ts +30 -0
- package/dist/pkg/src/index.js +85 -0
- package/dist/pkg/src/protocol.d.ts +64 -0
- package/dist/pkg/src/protocol.js +1 -0
- package/dist/pkg/src/types.d.ts +184 -0
- package/dist/pkg/src/types.js +16 -0
- package/dist/pkg/src/worker.d.ts +11 -0
- package/dist/pkg/src/worker.js +111 -0
- package/dist/pkg/src/workerClient.d.ts +3 -0
- package/dist/pkg/src/workerClient.js +202 -0
- package/dist/src/context-vocab.d.ts +1 -0
- package/dist/src/context-vocab.js +2 -0
- package/dist/src/context.d.ts +92 -0
- package/dist/src/context.js +390 -0
- package/dist/src/corrector.d.ts +338 -0
- package/dist/src/corrector.js +2684 -0
- package/dist/src/known.d.ts +88 -0
- package/dist/src/known.js +286 -0
- package/dist/src/lexicon-binary.d.ts +85 -0
- package/dist/src/lexicon-binary.js +805 -0
- package/dist/src/lexicon.d.ts +24 -0
- package/dist/src/lexicon.js +79 -0
- package/dist/src/morphology/analyzer.d.ts +30 -0
- package/dist/src/morphology/analyzer.js +311 -0
- package/dist/src/morphology/binary.d.ts +22 -0
- package/dist/src/morphology/binary.js +372 -0
- package/dist/src/morphology/dictionary.d.ts +21 -0
- package/dist/src/morphology/dictionary.js +559 -0
- package/dist/src/morphology/fuzzy.d.ts +44 -0
- package/dist/src/morphology/fuzzy.js +599 -0
- package/dist/src/morphology/index.d.ts +40 -0
- package/dist/src/morphology/index.js +81 -0
- package/dist/src/morphology/morphotactics.d.ts +148 -0
- package/dist/src/morphology/morphotactics.js +1871 -0
- package/dist/src/morphology/phonetics.d.ts +71 -0
- package/dist/src/morphology/phonetics.js +309 -0
- package/dist/src/morphology/prior.d.ts +61 -0
- package/dist/src/morphology/prior.js +457 -0
- package/dist/src/morphology/types.d.ts +110 -0
- package/dist/src/morphology/types.js +32 -0
- package/dist/src/rules/proper-names.d.ts +145 -0
- package/dist/src/rules/proper-names.js +1217 -0
- package/dist/src/rules/turkish-rules.d.ts +126 -0
- package/dist/src/rules/turkish-rules.js +365 -0
- package/dist/src/sentence.d.ts +83 -0
- package/dist/src/sentence.js +2408 -0
- package/dist/src/turkish.d.ts +20 -0
- package/dist/src/turkish.js +94 -0
- package/package.json +60 -4
|
@@ -0,0 +1,1871 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turkish morphotactic state machine graph.
|
|
3
|
+
* Adapted from Zemberek's TurkishMorphotactics.java and Conditions.java (Apache 2.0),
|
|
4
|
+
* with precision-focused adjustments for formal Turkish spellchecking:
|
|
5
|
+
* - Excludes colloquial vowel-dropped locative/ablative contractions (burda, içerde, ilerde...).
|
|
6
|
+
* - Excludes attached question particles (mi) and attached conjunctions (de/da/ki).
|
|
7
|
+
* - Adds productive -daş (>dAş) noun derivation and deyince/yiyince transitions.
|
|
8
|
+
* - Restricts nominalization (Adj -> Zero -> Noun) on non-nominalizable function adjectives
|
|
9
|
+
* (nasıl, öyle, böyle, şöyle, her, herhangi, birkaç, birçok, birtakım, bazı, hiçbir, tüm, bütün)
|
|
10
|
+
* and blocks locative -da on "daha" so clitic errors (*nasılda, *öylemi, *dahada) are rejected.
|
|
11
|
+
*/
|
|
12
|
+
import { lowerTr } from "../turkish.js";
|
|
13
|
+
import { PA_EXPECTS_CONSONANT, PA_EXPECTS_VOWEL, PA_LAST_CONSONANT, PA_LAST_LETTER_DROPPED, PA_LAST_VOWEL, PA_MODIFIED_PRONOUN, SURFACE_CACHE_SIZE, isVowel, tokenizeTemplate, } from "./phonetics.js";
|
|
14
|
+
import { RA_AORIST_A, RA_AORIST_I, RA_CAUSATIVE_T, RA_COMPOUND_P3SG, RA_COMPOUND_P3SG_ROOT, RA_FAMILY_MEMBER, RA_IMPLICIT_DATIVE, RA_IMPLICIT_P1SG, RA_IMPLICIT_P2SG, RA_IMPLICIT_PLURAL, RA_NOUN_CONS_INSERT_N, RA_NO_SUFFIX, RA_PASSIVE_IN, RA_RECIPROCAL, RA_REFLEXIVE, } from "./types.js";
|
|
15
|
+
// --- Morpheme definitions ---
|
|
16
|
+
function morpheme(id, pos = null, derivational = false) {
|
|
17
|
+
return { id, pos, derivational };
|
|
18
|
+
}
|
|
19
|
+
export const MORPHEMES = {
|
|
20
|
+
root: morpheme("Root"),
|
|
21
|
+
noun: morpheme("Noun", "Noun"),
|
|
22
|
+
adj: morpheme("Adj", "Adj"),
|
|
23
|
+
verb: morpheme("Verb", "Verb"),
|
|
24
|
+
pron: morpheme("Pron", "Pron"),
|
|
25
|
+
adv: morpheme("Adv", "Adv"),
|
|
26
|
+
conj: morpheme("Conj", "Conj"),
|
|
27
|
+
ques: morpheme("Ques", "Ques"),
|
|
28
|
+
postp: morpheme("Postp", "Postp"),
|
|
29
|
+
det: morpheme("Det", "Det"),
|
|
30
|
+
num: morpheme("Num", "Num"),
|
|
31
|
+
dup: morpheme("Dup", "Dup"),
|
|
32
|
+
interj: morpheme("Interj", "Interj"),
|
|
33
|
+
// Person / Number agreement
|
|
34
|
+
a1sg: morpheme("A1sg"),
|
|
35
|
+
a2sg: morpheme("A2sg"),
|
|
36
|
+
a3sg: morpheme("A3sg"),
|
|
37
|
+
a1pl: morpheme("A1pl"),
|
|
38
|
+
a2pl: morpheme("A2pl"),
|
|
39
|
+
a3pl: morpheme("A3pl"),
|
|
40
|
+
// Possessive
|
|
41
|
+
pnon: morpheme("Pnon"),
|
|
42
|
+
p1sg: morpheme("P1sg"),
|
|
43
|
+
p2sg: morpheme("P2sg"),
|
|
44
|
+
p3sg: morpheme("P3sg"),
|
|
45
|
+
p1pl: morpheme("P1pl"),
|
|
46
|
+
p2pl: morpheme("P2pl"),
|
|
47
|
+
p3pl: morpheme("P3pl"),
|
|
48
|
+
// Case
|
|
49
|
+
nom: morpheme("Nom"),
|
|
50
|
+
dat: morpheme("Dat"),
|
|
51
|
+
acc: morpheme("Acc"),
|
|
52
|
+
abl: morpheme("Abl"),
|
|
53
|
+
loc: morpheme("Loc"),
|
|
54
|
+
ins: morpheme("Ins"),
|
|
55
|
+
gen: morpheme("Gen"),
|
|
56
|
+
equ: morpheme("Equ"),
|
|
57
|
+
// Derivational
|
|
58
|
+
dim: morpheme("Dim", null, true),
|
|
59
|
+
ness: morpheme("Ness", null, true),
|
|
60
|
+
with: morpheme("With", null, true),
|
|
61
|
+
without: morpheme("Without", null, true),
|
|
62
|
+
related: morpheme("Related", null, true),
|
|
63
|
+
justLike: morpheme("JustLike", null, true),
|
|
64
|
+
rel: morpheme("Rel", null, true),
|
|
65
|
+
agt: morpheme("Agt", null, true),
|
|
66
|
+
dash: morpheme("Dash", null, true),
|
|
67
|
+
become: morpheme("Become", null, true),
|
|
68
|
+
acquire: morpheme("Acquire", null, true),
|
|
69
|
+
ly: morpheme("Ly", null, true),
|
|
70
|
+
caus: morpheme("Caus", null, true),
|
|
71
|
+
recip: morpheme("Recip", null, true),
|
|
72
|
+
reflex: morpheme("Reflex", null, true),
|
|
73
|
+
able: morpheme("Able", null, true),
|
|
74
|
+
pass: morpheme("Pass", null, true),
|
|
75
|
+
inf1: morpheme("Inf1", null, true),
|
|
76
|
+
inf2: morpheme("Inf2", null, true),
|
|
77
|
+
inf3: morpheme("Inf3", null, true),
|
|
78
|
+
actOf: morpheme("ActOf", null, true),
|
|
79
|
+
pastPart: morpheme("PastPart", null, true),
|
|
80
|
+
narrPart: morpheme("NarrPart", null, true),
|
|
81
|
+
futPart: morpheme("FutPart", null, true),
|
|
82
|
+
presPart: morpheme("PresPart", null, true),
|
|
83
|
+
aorPart: morpheme("AorPart", null, true),
|
|
84
|
+
notState: morpheme("NotState", null, true),
|
|
85
|
+
feelLike: morpheme("FeelLike", null, true),
|
|
86
|
+
everSince: morpheme("EverSince", null, true),
|
|
87
|
+
repeat: morpheme("Repeat", null, true),
|
|
88
|
+
almost: morpheme("Almost", null, true),
|
|
89
|
+
hastily: morpheme("Hastily", null, true),
|
|
90
|
+
stay: morpheme("Stay", null, true),
|
|
91
|
+
start: morpheme("Start", null, true),
|
|
92
|
+
asIf: morpheme("AsIf", null, true),
|
|
93
|
+
while_: morpheme("While", null, true),
|
|
94
|
+
when: morpheme("When", null, true),
|
|
95
|
+
sinceDoingSo: morpheme("SinceDoingSo", null, true),
|
|
96
|
+
asLongAs: morpheme("AsLongAs", null, true),
|
|
97
|
+
byDoingSo: morpheme("ByDoingSo", null, true),
|
|
98
|
+
adamantly: morpheme("Adamantly", null, true),
|
|
99
|
+
afterDoingSo: morpheme("AfterDoingSo", null, true),
|
|
100
|
+
withoutHavingDoneSo: morpheme("WithoutHavingDoneSo", null, true),
|
|
101
|
+
withoutBeingAbleToHaveDoneSo: morpheme("WithoutBeingAbleToHaveDoneSo", null, true),
|
|
102
|
+
zero: morpheme("Zero", null, true),
|
|
103
|
+
// Verbal inflection
|
|
104
|
+
cop: morpheme("Cop"),
|
|
105
|
+
neg: morpheme("Neg"),
|
|
106
|
+
unable: morpheme("Unable"),
|
|
107
|
+
pres: morpheme("Pres"),
|
|
108
|
+
past: morpheme("Past"),
|
|
109
|
+
narr: morpheme("Narr"),
|
|
110
|
+
cond: morpheme("Cond"),
|
|
111
|
+
prog1: morpheme("Prog1"),
|
|
112
|
+
prog2: morpheme("Prog2"),
|
|
113
|
+
aor: morpheme("Aor"),
|
|
114
|
+
fut: morpheme("Fut"),
|
|
115
|
+
imp: morpheme("Imp"),
|
|
116
|
+
opt: morpheme("Opt"),
|
|
117
|
+
desr: morpheme("Desr"),
|
|
118
|
+
neces: morpheme("Neces"),
|
|
119
|
+
};
|
|
120
|
+
// --- Condition combinators ---
|
|
121
|
+
const hasTail = (p) => p.pos < p.inputLength;
|
|
122
|
+
const hasSurface = (p) => p.hasSurface;
|
|
123
|
+
const hasNoSurface = (p) => !p.hasSurface;
|
|
124
|
+
const currentGroupEmpty = (p) => !p.currentGroupHasSurface;
|
|
125
|
+
function hasAttr(mask) {
|
|
126
|
+
return (p) => (p.stemTransition.item.attributes & mask) !== 0;
|
|
127
|
+
}
|
|
128
|
+
function notHaveAttr(mask) {
|
|
129
|
+
return (p) => (p.stemTransition.item.attributes & mask) === 0;
|
|
130
|
+
}
|
|
131
|
+
function hasPhon(mask) {
|
|
132
|
+
return (p) => (p.phonetic & mask) !== 0;
|
|
133
|
+
}
|
|
134
|
+
function notHavePhon(mask) {
|
|
135
|
+
return (p) => (p.phonetic & mask) === 0;
|
|
136
|
+
}
|
|
137
|
+
function rootKeyIs(key) {
|
|
138
|
+
return (p) => p.stemTransition.item.key === key;
|
|
139
|
+
}
|
|
140
|
+
function rootKeyIsNot(key) {
|
|
141
|
+
return (p) => p.stemTransition.item.key !== key;
|
|
142
|
+
}
|
|
143
|
+
function rootKeyIn(keys) {
|
|
144
|
+
const set = new Set(keys);
|
|
145
|
+
return (p) => set.has(p.stemTransition.item.key);
|
|
146
|
+
}
|
|
147
|
+
function rootKeyNotIn(keys) {
|
|
148
|
+
const set = new Set(keys);
|
|
149
|
+
return (p) => !set.has(p.stemTransition.item.key);
|
|
150
|
+
}
|
|
151
|
+
function rootSurfaceIs(surface) {
|
|
152
|
+
return (p) => p.stemTransition.surface === surface;
|
|
153
|
+
}
|
|
154
|
+
function rootSurfaceIn(surfaces) {
|
|
155
|
+
const set = new Set(surfaces);
|
|
156
|
+
return (p) => set.has(p.stemTransition.surface);
|
|
157
|
+
}
|
|
158
|
+
function secondaryPosIs(pos) {
|
|
159
|
+
return (p) => p.stemTransition.item.secondaryPos === pos;
|
|
160
|
+
}
|
|
161
|
+
function prevStateIs(state) {
|
|
162
|
+
return (p) => p.prev !== null && p.prev.state === state;
|
|
163
|
+
}
|
|
164
|
+
function prevStateIsNot(state) {
|
|
165
|
+
return (p) => p.prev === null || p.prev.state !== state;
|
|
166
|
+
}
|
|
167
|
+
function prevStateIn(states) {
|
|
168
|
+
const set = new Set(states);
|
|
169
|
+
return (p) => p.prev !== null && set.has(p.prev.state);
|
|
170
|
+
}
|
|
171
|
+
function prevMorphemeIs(m) {
|
|
172
|
+
return (p) => p.prev !== null && p.prev.state.morpheme === m;
|
|
173
|
+
}
|
|
174
|
+
function prevMorphemeIsNot(m) {
|
|
175
|
+
return (p) => p.prev === null || p.prev.state.morpheme !== m;
|
|
176
|
+
}
|
|
177
|
+
function prevMorphemeIn(ms) {
|
|
178
|
+
const set = new Set(ms);
|
|
179
|
+
return (p) => p.prev !== null && set.has(p.prev.state.morpheme);
|
|
180
|
+
}
|
|
181
|
+
function lastDerivIs(state) {
|
|
182
|
+
return (p) => p.lastDerivation === state;
|
|
183
|
+
}
|
|
184
|
+
function lastDerivIn(states) {
|
|
185
|
+
const set = new Set(states);
|
|
186
|
+
return (p) => p.lastDerivation !== null && set.has(p.lastDerivation);
|
|
187
|
+
}
|
|
188
|
+
function containsMorpheme(...ms) {
|
|
189
|
+
if (ms.length === 1) {
|
|
190
|
+
const target = ms[0];
|
|
191
|
+
return (p) => {
|
|
192
|
+
let cur = p;
|
|
193
|
+
while (cur !== null) {
|
|
194
|
+
if (cur.state.morpheme === target)
|
|
195
|
+
return true;
|
|
196
|
+
cur = cur.prev;
|
|
197
|
+
}
|
|
198
|
+
return false;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
const set = new Set(ms);
|
|
202
|
+
return (p) => {
|
|
203
|
+
let cur = p;
|
|
204
|
+
while (cur !== null) {
|
|
205
|
+
if (set.has(cur.state.morpheme))
|
|
206
|
+
return true;
|
|
207
|
+
cur = cur.prev;
|
|
208
|
+
}
|
|
209
|
+
return false;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function containsMorphemeSeq(...seq) {
|
|
213
|
+
const len = seq.length;
|
|
214
|
+
const last = seq[len - 1];
|
|
215
|
+
return (p) => {
|
|
216
|
+
let cur = p;
|
|
217
|
+
while (cur !== null) {
|
|
218
|
+
if (cur.state.morpheme === last) {
|
|
219
|
+
let probe = cur;
|
|
220
|
+
let idx = len - 1;
|
|
221
|
+
while (idx >= 0 && probe !== null && probe.state.morpheme === seq[idx]) {
|
|
222
|
+
idx--;
|
|
223
|
+
probe = probe.prev;
|
|
224
|
+
}
|
|
225
|
+
if (idx < 0)
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
cur = cur.prev;
|
|
229
|
+
}
|
|
230
|
+
return false;
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
function hasTailSeq(...seq) {
|
|
234
|
+
const len = seq.length;
|
|
235
|
+
return (p) => {
|
|
236
|
+
let cur = p;
|
|
237
|
+
for (let idx = len - 1; idx >= 0; idx--) {
|
|
238
|
+
if (cur === null || cur.state.morpheme !== seq[idx])
|
|
239
|
+
return false;
|
|
240
|
+
cur = cur.prev;
|
|
241
|
+
}
|
|
242
|
+
return true;
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function currentGroupContains(...states) {
|
|
246
|
+
const set = new Set(states);
|
|
247
|
+
return (p) => {
|
|
248
|
+
let cur = p;
|
|
249
|
+
while (cur !== null && cur.prev !== null) {
|
|
250
|
+
if (set.has(cur.state))
|
|
251
|
+
return true;
|
|
252
|
+
if (cur.state.derivative)
|
|
253
|
+
return false;
|
|
254
|
+
cur = cur.prev;
|
|
255
|
+
}
|
|
256
|
+
return false;
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
function prevGroupContains(...states) {
|
|
260
|
+
const set = new Set(states);
|
|
261
|
+
return (p) => {
|
|
262
|
+
let cur = p;
|
|
263
|
+
while (cur !== null && !cur.state.derivative) {
|
|
264
|
+
cur = cur.prev;
|
|
265
|
+
}
|
|
266
|
+
if (cur === null || cur.prev === null)
|
|
267
|
+
return false;
|
|
268
|
+
cur = cur.prev;
|
|
269
|
+
while (cur !== null && cur.prev !== null) {
|
|
270
|
+
if (set.has(cur.state))
|
|
271
|
+
return true;
|
|
272
|
+
if (cur.state.derivative)
|
|
273
|
+
return false;
|
|
274
|
+
cur = cur.prev;
|
|
275
|
+
}
|
|
276
|
+
return false;
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
function prevGroupContainsMorpheme(...ms) {
|
|
280
|
+
const set = new Set(ms);
|
|
281
|
+
return (p) => {
|
|
282
|
+
let cur = p;
|
|
283
|
+
while (cur !== null && !cur.state.derivative) {
|
|
284
|
+
cur = cur.prev;
|
|
285
|
+
}
|
|
286
|
+
if (cur === null || cur.prev === null)
|
|
287
|
+
return false;
|
|
288
|
+
cur = cur.prev;
|
|
289
|
+
while (cur !== null && cur.prev !== null) {
|
|
290
|
+
if (set.has(cur.state.morpheme))
|
|
291
|
+
return true;
|
|
292
|
+
if (cur.state.derivative)
|
|
293
|
+
return false;
|
|
294
|
+
cur = cur.prev;
|
|
295
|
+
}
|
|
296
|
+
return false;
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
function and(...conds) {
|
|
300
|
+
return (p) => {
|
|
301
|
+
for (let i = 0; i < conds.length; i++) {
|
|
302
|
+
const c = conds[i];
|
|
303
|
+
if (c !== undefined && !c(p))
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
return true;
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
function or(...conds) {
|
|
310
|
+
return (p) => {
|
|
311
|
+
for (let i = 0; i < conds.length; i++) {
|
|
312
|
+
const c = conds[i];
|
|
313
|
+
if (c !== undefined && c(p))
|
|
314
|
+
return true;
|
|
315
|
+
}
|
|
316
|
+
return false;
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
function not(cond) {
|
|
320
|
+
return (p) => !cond(p);
|
|
321
|
+
}
|
|
322
|
+
// --- State and transition builders ---
|
|
323
|
+
function makeState(id, m, opts) {
|
|
324
|
+
return {
|
|
325
|
+
id,
|
|
326
|
+
morpheme: m,
|
|
327
|
+
terminal: opts?.terminal ?? false,
|
|
328
|
+
derivative: opts?.derivative ?? false,
|
|
329
|
+
posRoot: opts?.posRoot ?? false,
|
|
330
|
+
outgoing: [],
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function computeForbiddenPhonetic(template) {
|
|
334
|
+
if (template.length === 0)
|
|
335
|
+
return 0;
|
|
336
|
+
const lower = lowerTr(template);
|
|
337
|
+
const first = lower[0] ?? "";
|
|
338
|
+
const firstCharVowel = isVowel(first);
|
|
339
|
+
let forbidden = 0;
|
|
340
|
+
if (first === ">" || !firstCharVowel) {
|
|
341
|
+
forbidden = PA_EXPECTS_VOWEL;
|
|
342
|
+
}
|
|
343
|
+
const third = lower[2];
|
|
344
|
+
if ((first === "+" && third !== undefined && isVowel(third)) || firstCharVowel) {
|
|
345
|
+
forbidden = PA_EXPECTS_CONSONANT;
|
|
346
|
+
}
|
|
347
|
+
return forbidden;
|
|
348
|
+
}
|
|
349
|
+
function addTransition(from, to, template, condition = null) {
|
|
350
|
+
const tokens = tokenizeTemplate(template);
|
|
351
|
+
const transition = {
|
|
352
|
+
from,
|
|
353
|
+
to,
|
|
354
|
+
template,
|
|
355
|
+
tokens,
|
|
356
|
+
lastToken: tokens.length > 0 ? tokens[tokens.length - 1] : undefined,
|
|
357
|
+
hasSurface: tokens.length > 0,
|
|
358
|
+
condition,
|
|
359
|
+
forbiddenPhonetic: computeForbiddenPhonetic(template),
|
|
360
|
+
surfaceCache: new Array(SURFACE_CACHE_SIZE),
|
|
361
|
+
nextPhoneticCache: new Int32Array(SURFACE_CACHE_SIZE),
|
|
362
|
+
};
|
|
363
|
+
from.outgoing.push(transition);
|
|
364
|
+
}
|
|
365
|
+
function addEmpty(from, to, condition = null) {
|
|
366
|
+
addTransition(from, to, "", condition);
|
|
367
|
+
}
|
|
368
|
+
function copyOutgoing(target, source) {
|
|
369
|
+
for (const t of source.outgoing) {
|
|
370
|
+
target.outgoing.push({
|
|
371
|
+
from: target,
|
|
372
|
+
to: t.to,
|
|
373
|
+
template: t.template,
|
|
374
|
+
tokens: t.tokens,
|
|
375
|
+
lastToken: t.lastToken,
|
|
376
|
+
hasSurface: t.hasSurface,
|
|
377
|
+
condition: t.condition,
|
|
378
|
+
forbiddenPhonetic: t.forbiddenPhonetic,
|
|
379
|
+
surfaceCache: t.surfaceCache,
|
|
380
|
+
nextPhoneticCache: t.nextPhoneticCache,
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
function removeTransitionsToMorpheme(state, m) {
|
|
385
|
+
for (let i = state.outgoing.length - 1; i >= 0; i--) {
|
|
386
|
+
if (state.outgoing[i]?.to.morpheme === m) {
|
|
387
|
+
state.outgoing.splice(i, 1);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
// Non-nominalizable closed-class function adjectives: they can take copula (nasılsın, öyleydi)
|
|
392
|
+
// via adjZeroDeriv -> nVerb_S, but should NOT take arbitrary noun case/possessive inflection
|
|
393
|
+
// (*nasılda, *öylemi, *herde, *birkaçta).
|
|
394
|
+
const NON_NOMINALIZABLE_ADJ_LEMMAS = new Set([
|
|
395
|
+
"nasıl",
|
|
396
|
+
"öyle",
|
|
397
|
+
"böyle",
|
|
398
|
+
"şöyle",
|
|
399
|
+
"her",
|
|
400
|
+
"herhangi",
|
|
401
|
+
"birkaç",
|
|
402
|
+
"birçok",
|
|
403
|
+
"birtakım",
|
|
404
|
+
"bazı",
|
|
405
|
+
"hiçbir",
|
|
406
|
+
"tüm",
|
|
407
|
+
"bütün",
|
|
408
|
+
]);
|
|
409
|
+
let cachedGraph = null;
|
|
410
|
+
/**
|
|
411
|
+
* Returns the shared immutable Turkish morphotactics graph (singleton).
|
|
412
|
+
*/
|
|
413
|
+
export function getMorphotacticsGraph() {
|
|
414
|
+
if (cachedGraph !== null)
|
|
415
|
+
return cachedGraph;
|
|
416
|
+
const M = MORPHEMES;
|
|
417
|
+
// --- Noun states ---
|
|
418
|
+
const noun_S = makeState("noun_S", M.noun, { posRoot: true });
|
|
419
|
+
const nounCompoundRoot_S = makeState("nounCompoundRoot_S", M.noun, { posRoot: true });
|
|
420
|
+
const nounSuRoot_S = makeState("nounSuRoot_S", M.noun, { posRoot: true });
|
|
421
|
+
const nounInf1Root_S = makeState("nounInf1Root_S", M.noun, { posRoot: true });
|
|
422
|
+
const nounActOfRoot_S = makeState("nounActOfRoot_S", M.noun, { posRoot: true });
|
|
423
|
+
const nounProper_S = makeState("nounProper_S", M.noun, { posRoot: true });
|
|
424
|
+
const nounAbbrv_S = makeState("nounAbbrv_S", M.noun, { posRoot: true });
|
|
425
|
+
const nounNoSuffix_S = makeState("nounNoSuffix_S", M.noun, { posRoot: true });
|
|
426
|
+
const nounA3sgNoSuffix_S = makeState("nounA3sgNoSuffix_S", M.a3sg);
|
|
427
|
+
const nounPnonNoSuffix_S = makeState("nounPnonNoSuffix_S", M.pnon);
|
|
428
|
+
const nounNomNoSuffix_ST = makeState("nounNomNoSuffix_ST", M.nom, { terminal: true });
|
|
429
|
+
const a3sg_S = makeState("a3sg_S", M.a3sg);
|
|
430
|
+
const a3sgSu_S = makeState("a3sgSu_S", M.a3sg);
|
|
431
|
+
const a3sgCompound_S = makeState("a3sgCompound_S", M.a3sg);
|
|
432
|
+
const a3sgInf1_S = makeState("a3sgInf1_S", M.a3sg);
|
|
433
|
+
const a3sgActOf_S = makeState("a3sgActOf_S", M.a3sg);
|
|
434
|
+
const a3pl_S = makeState("a3pl_S", M.a3pl);
|
|
435
|
+
const a3plActOf_S = makeState("a3plActOf_S", M.a3pl);
|
|
436
|
+
const a3plCompound_S = makeState("a3plCompound_S", M.a3pl);
|
|
437
|
+
const a3plCompound2_S = makeState("a3plCompound2_S", M.a3pl);
|
|
438
|
+
const pnon_S = makeState("pnon_S", M.pnon);
|
|
439
|
+
const pnonCompound_S = makeState("pnonCompound_S", M.pnon);
|
|
440
|
+
const pnonCompound2_S = makeState("pnonCompound2_S", M.pnon);
|
|
441
|
+
const pnonInf1_S = makeState("pnonInf1_S", M.pnon);
|
|
442
|
+
const pnonActOf_S = makeState("pnonActOf_S", M.pnon);
|
|
443
|
+
const p1sg_S = makeState("p1sg_S", M.p1sg);
|
|
444
|
+
const p2sg_S = makeState("p2sg_S", M.p2sg);
|
|
445
|
+
const p3sg_S = makeState("p3sg_S", M.p3sg);
|
|
446
|
+
const p1pl_S = makeState("p1pl_S", M.p1pl);
|
|
447
|
+
const p2pl_S = makeState("p2pl_S", M.p2pl);
|
|
448
|
+
const p3pl_S = makeState("p3pl_S", M.p3pl);
|
|
449
|
+
const nom_ST = makeState("nom_ST", M.nom, { terminal: true });
|
|
450
|
+
const nom_S = makeState("nom_S", M.nom);
|
|
451
|
+
const dat_ST = makeState("dat_ST", M.dat, { terminal: true });
|
|
452
|
+
const abl_ST = makeState("abl_ST", M.abl, { terminal: true });
|
|
453
|
+
const loc_ST = makeState("loc_ST", M.loc, { terminal: true });
|
|
454
|
+
const ins_ST = makeState("ins_ST", M.ins, { terminal: true });
|
|
455
|
+
const acc_ST = makeState("acc_ST", M.acc, { terminal: true });
|
|
456
|
+
const gen_ST = makeState("gen_ST", M.gen, { terminal: true });
|
|
457
|
+
const equ_ST = makeState("equ_ST", M.equ, { terminal: true });
|
|
458
|
+
const dim_S = makeState("dim_S", M.dim, { derivative: true });
|
|
459
|
+
const ness_S = makeState("ness_S", M.ness, { derivative: true });
|
|
460
|
+
const agt_S = makeState("agt_S", M.agt, { derivative: true });
|
|
461
|
+
const dash_S = makeState("dash_S", M.dash, { derivative: true });
|
|
462
|
+
const related_S = makeState("related_S", M.related, { derivative: true });
|
|
463
|
+
const rel_S = makeState("rel_S", M.rel, { derivative: true });
|
|
464
|
+
const relToPron_S = makeState("relToPron_S", M.rel, { derivative: true });
|
|
465
|
+
const with_S = makeState("with_S", M.with, { derivative: true });
|
|
466
|
+
const without_S = makeState("without_S", M.without, { derivative: true });
|
|
467
|
+
const justLike_S = makeState("justLike_S", M.justLike, { derivative: true });
|
|
468
|
+
const nounZeroDeriv_S = makeState("nounZeroDeriv_S", M.zero, { derivative: true });
|
|
469
|
+
const become_S = makeState("become_S", M.become, { derivative: true });
|
|
470
|
+
const acquire_S = makeState("acquire_S", M.acquire, { derivative: true });
|
|
471
|
+
// --- Adjective states ---
|
|
472
|
+
const adjectiveRoot_ST = makeState("adjectiveRoot_ST", M.adj, { terminal: true, posRoot: true });
|
|
473
|
+
const adjNoSuffix_ST = makeState("adjNoSuffix_ST", M.adj, { terminal: true, posRoot: true });
|
|
474
|
+
const adjAfterVerb_S = makeState("adjAfterVerb_S", M.adj, { posRoot: true });
|
|
475
|
+
const adjAfterVerb_ST = makeState("adjAfterVerb_ST", M.adj, { terminal: true, posRoot: true });
|
|
476
|
+
const adjZeroDeriv_S = makeState("adjZeroDeriv_S", M.zero, { derivative: true });
|
|
477
|
+
const aPnon_ST = makeState("aPnon_ST", M.pnon, { terminal: true });
|
|
478
|
+
const aP1sg_ST = makeState("aP1sg_ST", M.p1sg, { terminal: true });
|
|
479
|
+
const aP2sg_ST = makeState("aP2sg_ST", M.p2sg, { terminal: true });
|
|
480
|
+
const aP3sg_ST = makeState("aP3sg_ST", M.p3sg, { terminal: true });
|
|
481
|
+
const aP1pl_ST = makeState("aP1pl_ST", M.p1pl, { terminal: true });
|
|
482
|
+
const aP2pl_ST = makeState("aP2pl_ST", M.p2pl, { terminal: true });
|
|
483
|
+
const aP3pl_ST = makeState("aP3pl_ST", M.p3pl, { terminal: true });
|
|
484
|
+
const aLy_S = makeState("aLy_S", M.ly, { derivative: true });
|
|
485
|
+
const aAsIf_S = makeState("aAsIf_S", M.asIf, { derivative: true });
|
|
486
|
+
const aAgt_S = makeState("aAgt_S", M.agt, { derivative: true });
|
|
487
|
+
const aorPartNegZero_S = makeState("aorPartNegZero_S", M.zero, { derivative: true });
|
|
488
|
+
const aorPartNegNoun_S = makeState("aorPartNegNoun_S", M.noun, { posRoot: true });
|
|
489
|
+
const aorPartNegA3sg_S = makeState("aorPartNegA3sg_S", M.a3sg);
|
|
490
|
+
const aorPartNegPnon_S = makeState("aorPartNegPnon_S", M.pnon);
|
|
491
|
+
const aorPartNegAbl_ST = makeState("aorPartNegAbl_ST", M.abl, { terminal: true });
|
|
492
|
+
// --- Numeral states ---
|
|
493
|
+
const numeralRoot_ST = makeState("numeralRoot_ST", M.num, { terminal: true, posRoot: true });
|
|
494
|
+
const numZeroDeriv_S = makeState("numZeroDeriv_S", M.zero, { derivative: true });
|
|
495
|
+
// --- Nominal predicate (ek-fiil) states ---
|
|
496
|
+
const nVerb_S = makeState("nVerb_S", M.verb, { posRoot: true });
|
|
497
|
+
const nVerbDegil_S = makeState("nVerbDegil_S", M.verb, { posRoot: true });
|
|
498
|
+
const nPresent_S = makeState("nPresent_S", M.pres);
|
|
499
|
+
const nPast_S = makeState("nPast_S", M.past);
|
|
500
|
+
const nNarr_S = makeState("nNarr_S", M.narr);
|
|
501
|
+
const nCond_S = makeState("nCond_S", M.cond);
|
|
502
|
+
const nA1sg_ST = makeState("nA1sg_ST", M.a1sg, { terminal: true });
|
|
503
|
+
const nA2sg_ST = makeState("nA2sg_ST", M.a2sg, { terminal: true });
|
|
504
|
+
const nA1pl_ST = makeState("nA1pl_ST", M.a1pl, { terminal: true });
|
|
505
|
+
const nA2pl_ST = makeState("nA2pl_ST", M.a2pl, { terminal: true });
|
|
506
|
+
const nA3sg_ST = makeState("nA3sg_ST", M.a3sg, { terminal: true });
|
|
507
|
+
const nA3sg_S = makeState("nA3sg_S", M.a3sg);
|
|
508
|
+
const nA3pl_ST = makeState("nA3pl_ST", M.a3pl, { terminal: true });
|
|
509
|
+
const nCop_ST = makeState("nCop_ST", M.cop, { terminal: true });
|
|
510
|
+
const nCopBeforeA3pl_S = makeState("nCopBeforeA3pl_S", M.cop);
|
|
511
|
+
const nNeg_S = makeState("nNeg_S", M.neg);
|
|
512
|
+
// --- Pronoun states ---
|
|
513
|
+
const pronPers_S = makeState("pronPers_S", M.pron, { posRoot: true });
|
|
514
|
+
const pronPers_Mod_S = makeState("pronPers_Mod_S", M.pron, { posRoot: true });
|
|
515
|
+
const pronDemons_S = makeState("pronDemons_S", M.pron, { posRoot: true });
|
|
516
|
+
const pronQuant_S = makeState("pronQuant_S", M.pron, { posRoot: true });
|
|
517
|
+
const pronQuantModified_S = makeState("pronQuantModified_S", M.pron, { posRoot: true });
|
|
518
|
+
const pronQues_S = makeState("pronQues_S", M.pron, { posRoot: true });
|
|
519
|
+
const pronReflex_S = makeState("pronReflex_S", M.pron, { posRoot: true });
|
|
520
|
+
const pronAfterRel_S = makeState("pronAfterRel_S", M.pron, { posRoot: true });
|
|
521
|
+
const pA1sg_S = makeState("pA1sg_S", M.a1sg);
|
|
522
|
+
const pA2sg_S = makeState("pA2sg_S", M.a2sg);
|
|
523
|
+
const pA1sgMod_S = makeState("pA1sgMod_S", M.a1sg);
|
|
524
|
+
const pA2sgMod_S = makeState("pA2sgMod_S", M.a2sg);
|
|
525
|
+
const pA3sg_S = makeState("pA3sg_S", M.a3sg);
|
|
526
|
+
const pA3sgRel_S = makeState("pA3sgRel_S", M.a3sg);
|
|
527
|
+
const pA1pl_S = makeState("pA1pl_S", M.a1pl);
|
|
528
|
+
const pA2pl_S = makeState("pA2pl_S", M.a2pl);
|
|
529
|
+
const pA3pl_S = makeState("pA3pl_S", M.a3pl);
|
|
530
|
+
const pA3plRel_S = makeState("pA3plRel_S", M.a3pl);
|
|
531
|
+
const pQuantA3sg_S = makeState("pQuantA3sg_S", M.a3sg);
|
|
532
|
+
const pQuantA3pl_S = makeState("pQuantA3pl_S", M.a3pl);
|
|
533
|
+
const pQuantModA3pl_S = makeState("pQuantModA3pl_S", M.a3pl);
|
|
534
|
+
const pQuantA1pl_S = makeState("pQuantA1pl_S", M.a1pl);
|
|
535
|
+
const pQuantA2pl_S = makeState("pQuantA2pl_S", M.a2pl);
|
|
536
|
+
const pQuesA3sg_S = makeState("pQuesA3sg_S", M.a3sg);
|
|
537
|
+
const pQuesA3pl_S = makeState("pQuesA3pl_S", M.a3pl);
|
|
538
|
+
const pReflexA1sg_S = makeState("pReflexA1sg_S", M.a1sg);
|
|
539
|
+
const pReflexA2sg_S = makeState("pReflexA2sg_S", M.a2sg);
|
|
540
|
+
const pReflexA3sg_S = makeState("pReflexA3sg_S", M.a3sg);
|
|
541
|
+
const pReflexA1pl_S = makeState("pReflexA1pl_S", M.a1pl);
|
|
542
|
+
const pReflexA2pl_S = makeState("pReflexA2pl_S", M.a2pl);
|
|
543
|
+
const pReflexA3pl_S = makeState("pReflexA3pl_S", M.a3pl);
|
|
544
|
+
const pPnon_S = makeState("pPnon_S", M.pnon);
|
|
545
|
+
const pPnonRel_S = makeState("pPnonRel_S", M.pnon);
|
|
546
|
+
const pPnonMod_S = makeState("pPnonMod_S", M.pnon);
|
|
547
|
+
const pP1sg_S = makeState("pP1sg_S", M.p1sg);
|
|
548
|
+
const pP2sg_S = makeState("pP2sg_S", M.p2sg);
|
|
549
|
+
const pP3sg_S = makeState("pP3sg_S", M.p3sg);
|
|
550
|
+
const pP1pl_S = makeState("pP1pl_S", M.p1pl);
|
|
551
|
+
const pP2pl_S = makeState("pP2pl_S", M.p2pl);
|
|
552
|
+
const pP3pl_S = makeState("pP3pl_S", M.p3pl);
|
|
553
|
+
const pNom_ST = makeState("pNom_ST", M.nom, { terminal: true });
|
|
554
|
+
const pDat_ST = makeState("pDat_ST", M.dat, { terminal: true });
|
|
555
|
+
const pAcc_ST = makeState("pAcc_ST", M.acc, { terminal: true });
|
|
556
|
+
const pAbl_ST = makeState("pAbl_ST", M.abl, { terminal: true });
|
|
557
|
+
const pLoc_ST = makeState("pLoc_ST", M.loc, { terminal: true });
|
|
558
|
+
const pGen_ST = makeState("pGen_ST", M.gen, { terminal: true });
|
|
559
|
+
const pIns_ST = makeState("pIns_ST", M.ins, { terminal: true });
|
|
560
|
+
const pEqu_ST = makeState("pEqu_ST", M.equ, { terminal: true });
|
|
561
|
+
const pronZeroDeriv_S = makeState("pronZeroDeriv_S", M.zero, { derivative: true });
|
|
562
|
+
const pvVerbRoot_S = makeState("pvVerbRoot_S", M.verb, { posRoot: true });
|
|
563
|
+
const pvPresent_S = makeState("pvPresent_S", M.pres);
|
|
564
|
+
const pvPast_S = makeState("pvPast_S", M.past);
|
|
565
|
+
const pvNarr_S = makeState("pvNarr_S", M.narr);
|
|
566
|
+
const pvCond_S = makeState("pvCond_S", M.cond);
|
|
567
|
+
const pvA1sg_ST = makeState("pvA1sg_ST", M.a1sg, { terminal: true });
|
|
568
|
+
const pvA2sg_ST = makeState("pvA2sg_ST", M.a2sg, { terminal: true });
|
|
569
|
+
const pvA3sg_ST = makeState("pvA3sg_ST", M.a3sg, { terminal: true });
|
|
570
|
+
const pvA3sg_S = makeState("pvA3sg_S", M.a3sg);
|
|
571
|
+
const pvA1pl_ST = makeState("pvA1pl_ST", M.a1pl, { terminal: true });
|
|
572
|
+
const pvA2pl_ST = makeState("pvA2pl_ST", M.a2pl, { terminal: true });
|
|
573
|
+
const pvA3pl_ST = makeState("pvA3pl_ST", M.a3pl, { terminal: true });
|
|
574
|
+
const pvCopBeforeA3pl_S = makeState("pvCopBeforeA3pl_S", M.cop);
|
|
575
|
+
const pvCop_ST = makeState("pvCop_ST", M.cop, { terminal: true });
|
|
576
|
+
// --- Adverb / Closed class / Postpositive states ---
|
|
577
|
+
const advRoot_ST = makeState("advRoot_ST", M.adv, { terminal: true, posRoot: true });
|
|
578
|
+
const advNounRoot_ST = makeState("advNounRoot_ST", M.adv, { terminal: true, posRoot: true });
|
|
579
|
+
const advForVerbDeriv_ST = makeState("advForVerbDeriv_ST", M.adv, { terminal: true, posRoot: true });
|
|
580
|
+
const avNounAfterAdvRoot_S = makeState("avNounAfterAdvRoot_S", M.noun, { posRoot: true });
|
|
581
|
+
const avA3sg_S = makeState("avA3sg_S", M.a3sg);
|
|
582
|
+
const avPnon_S = makeState("avPnon_S", M.pnon);
|
|
583
|
+
const avDat_ST = makeState("avDat_ST", M.dat, { terminal: true });
|
|
584
|
+
const avZero_S = makeState("avZero_S", M.zero, { derivative: true });
|
|
585
|
+
const avZeroToVerb_S = makeState("avZeroToVerb_S", M.zero, { derivative: true });
|
|
586
|
+
const conjRoot_ST = makeState("conjRoot_ST", M.conj, { terminal: true, posRoot: true });
|
|
587
|
+
const interjRoot_ST = makeState("interjRoot_ST", M.interj, { terminal: true, posRoot: true });
|
|
588
|
+
const detRoot_ST = makeState("detRoot_ST", M.det, { terminal: true, posRoot: true });
|
|
589
|
+
const dupRoot_ST = makeState("dupRoot_ST", M.dup, { terminal: true, posRoot: true });
|
|
590
|
+
const postpRoot_ST = makeState("postpRoot_ST", M.postp, { terminal: true, posRoot: true });
|
|
591
|
+
const postpZero_S = makeState("postpZero_S", M.zero, { derivative: true });
|
|
592
|
+
const po2nRoot_S = makeState("po2nRoot_S", M.noun);
|
|
593
|
+
const po2nA3sg_S = makeState("po2nA3sg_S", M.a3sg);
|
|
594
|
+
const po2nA3pl_S = makeState("po2nA3pl_S", M.a3pl);
|
|
595
|
+
const po2nP3sg_S = makeState("po2nP3sg_S", M.p3sg);
|
|
596
|
+
const po2nP1sg_S = makeState("po2nP1sg_S", M.p1sg);
|
|
597
|
+
const po2nP2sg_S = makeState("po2nP2sg_S", M.p2sg);
|
|
598
|
+
const po2nP1pl_S = makeState("po2nP1pl_S", M.p1pl);
|
|
599
|
+
const po2nP2pl_S = makeState("po2nP2pl_S", M.p2pl);
|
|
600
|
+
const po2nPnon_S = makeState("po2nPnon_S", M.pnon);
|
|
601
|
+
const po2nNom_ST = makeState("po2nNom_ST", M.nom, { terminal: true });
|
|
602
|
+
const po2nDat_ST = makeState("po2nDat_ST", M.dat, { terminal: true });
|
|
603
|
+
const po2nAbl_ST = makeState("po2nAbl_ST", M.abl, { terminal: true });
|
|
604
|
+
const po2nLoc_ST = makeState("po2nLoc_ST", M.loc, { terminal: true });
|
|
605
|
+
const po2nIns_ST = makeState("po2nIns_ST", M.ins, { terminal: true });
|
|
606
|
+
const po2nAcc_ST = makeState("po2nAcc_ST", M.acc, { terminal: true });
|
|
607
|
+
const po2nGen_ST = makeState("po2nGen_ST", M.gen, { terminal: true });
|
|
608
|
+
const po2nEqu_ST = makeState("po2nEqu_ST", M.equ, { terminal: true });
|
|
609
|
+
// --- Verb states ---
|
|
610
|
+
const verbRoot_S = makeState("verbRoot_S", M.verb, { posRoot: true });
|
|
611
|
+
const verbRoot_VowelDrop_S = makeState("verbRoot_VowelDrop_S", M.verb, { posRoot: true });
|
|
612
|
+
const verbLastVowelDropModRoot_S = makeState("verbLastVowelDropModRoot_S", M.verb, { posRoot: true });
|
|
613
|
+
const verbLastVowelDropUnmodRoot_S = makeState("verbLastVowelDropUnmodRoot_S", M.verb, { posRoot: true });
|
|
614
|
+
const vDeYeRoot_S = makeState("vDeYeRoot_S", M.verb, { posRoot: true });
|
|
615
|
+
const vA1sg_ST = makeState("vA1sg_ST", M.a1sg, { terminal: true });
|
|
616
|
+
const vA2sg_ST = makeState("vA2sg_ST", M.a2sg, { terminal: true });
|
|
617
|
+
const vA3sg_ST = makeState("vA3sg_ST", M.a3sg, { terminal: true });
|
|
618
|
+
const vA1pl_ST = makeState("vA1pl_ST", M.a1pl, { terminal: true });
|
|
619
|
+
const vA2pl_ST = makeState("vA2pl_ST", M.a2pl, { terminal: true });
|
|
620
|
+
const vA3pl_ST = makeState("vA3pl_ST", M.a3pl, { terminal: true });
|
|
621
|
+
const vPast_S = makeState("vPast_S", M.past);
|
|
622
|
+
const vNarr_S = makeState("vNarr_S", M.narr);
|
|
623
|
+
const vCond_S = makeState("vCond_S", M.cond);
|
|
624
|
+
const vCondAfterPerson_ST = makeState("vCondAfterPerson_ST", M.cond, { terminal: true });
|
|
625
|
+
const vPastAfterTense_S = makeState("vPastAfterTense_S", M.past);
|
|
626
|
+
const vNarrAfterTense_S = makeState("vNarrAfterTense_S", M.narr);
|
|
627
|
+
const vPastAfterTense_ST = makeState("vPastAfterTense_ST", M.past, { terminal: true });
|
|
628
|
+
const vNarrAfterTense_ST = makeState("vNarrAfterTense_ST", M.narr, { terminal: true });
|
|
629
|
+
const vCond_ST = makeState("vCond_ST", M.cond, { terminal: true });
|
|
630
|
+
const vProgYor_S = makeState("vProgYor_S", M.prog1);
|
|
631
|
+
const vProgMakta_S = makeState("vProgMakta_S", M.prog2);
|
|
632
|
+
const vFut_S = makeState("vFut_S", M.fut);
|
|
633
|
+
const vCop_ST = makeState("vCop_ST", M.cop, { terminal: true });
|
|
634
|
+
const vCopBeforeA3pl_S = makeState("vCopBeforeA3pl_S", M.cop);
|
|
635
|
+
const vNeg_S = makeState("vNeg_S", M.neg);
|
|
636
|
+
const vUnable_S = makeState("vUnable_S", M.unable);
|
|
637
|
+
const vNegProg1_S = makeState("vNegProg1_S", M.neg);
|
|
638
|
+
const vUnableProg1_S = makeState("vUnableProg1_S", M.unable);
|
|
639
|
+
const vImp_S = makeState("vImp_S", M.imp);
|
|
640
|
+
const vImpYemekYi_S = makeState("vImpYemekYi_S", M.imp);
|
|
641
|
+
const vImpYemekYe_S = makeState("vImpYemekYe_S", M.imp);
|
|
642
|
+
const vCausT_S = makeState("vCausT_S", M.caus, { derivative: true });
|
|
643
|
+
const vCausTır_S = makeState("vCausTır_S", M.caus, { derivative: true });
|
|
644
|
+
const vRecip_S = makeState("vRecip_S", M.recip, { derivative: true });
|
|
645
|
+
const vImplicitRecipRoot_S = makeState("vImplicitRecipRoot_S", M.verb, { posRoot: true });
|
|
646
|
+
const vReflex_S = makeState("vReflex_S", M.reflex, { derivative: true });
|
|
647
|
+
const vImplicitReflexRoot_S = makeState("vImplicitReflexRoot_S", M.verb, { posRoot: true });
|
|
648
|
+
const vAor_S = makeState("vAor_S", M.aor);
|
|
649
|
+
const vAorNeg_S = makeState("vAorNeg_S", M.aor);
|
|
650
|
+
const vAorNegEmpty_S = makeState("vAorNegEmpty_S", M.aor);
|
|
651
|
+
const vAorPartNeg_S = makeState("vAorPartNeg_S", M.aorPart, { derivative: true });
|
|
652
|
+
const vAorPart_S = makeState("vAorPart_S", M.aorPart, { derivative: true });
|
|
653
|
+
const vAble_S = makeState("vAble_S", M.able, { derivative: true });
|
|
654
|
+
const vAbleNeg_S = makeState("vAbleNeg_S", M.able, { derivative: true });
|
|
655
|
+
const vAbleNegDerivRoot_S = makeState("vAbleNegDerivRoot_S", M.verb, { posRoot: true });
|
|
656
|
+
const vPass_S = makeState("vPass_S", M.pass, { derivative: true });
|
|
657
|
+
const vOpt_S = makeState("vOpt_S", M.opt);
|
|
658
|
+
const vDesr_S = makeState("vDesr_S", M.desr);
|
|
659
|
+
const vNeces_S = makeState("vNeces_S", M.neces);
|
|
660
|
+
const vInf1_S = makeState("vInf1_S", M.inf1, { derivative: true });
|
|
661
|
+
const vInf2_S = makeState("vInf2_S", M.inf2, { derivative: true });
|
|
662
|
+
const vInf3_S = makeState("vInf3_S", M.inf3, { derivative: true });
|
|
663
|
+
const vAgt_S = makeState("vAgt_S", M.agt, { derivative: true });
|
|
664
|
+
const vActOf_S = makeState("vActOf_S", M.actOf, { derivative: true });
|
|
665
|
+
const vPastPart_S = makeState("vPastPart_S", M.pastPart, { derivative: true });
|
|
666
|
+
const vFutPart_S = makeState("vFutPart_S", M.futPart, { derivative: true });
|
|
667
|
+
const vPresPart_S = makeState("vPresPart_S", M.presPart, { derivative: true });
|
|
668
|
+
const vNarrPart_S = makeState("vNarrPart_S", M.narrPart, { derivative: true });
|
|
669
|
+
const vFeelLike_S = makeState("vFeelLike_S", M.feelLike, { derivative: true });
|
|
670
|
+
const vNotState_S = makeState("vNotState_S", M.notState, { derivative: true });
|
|
671
|
+
const vEverSince_S = makeState("vEverSince_S", M.everSince, { derivative: true });
|
|
672
|
+
const vRepeat_S = makeState("vRepeat_S", M.repeat, { derivative: true });
|
|
673
|
+
const vAlmost_S = makeState("vAlmost_S", M.almost, { derivative: true });
|
|
674
|
+
const vHastily_S = makeState("vHastily_S", M.hastily, { derivative: true });
|
|
675
|
+
const vStay_S = makeState("vStay_S", M.stay, { derivative: true });
|
|
676
|
+
const vStart_S = makeState("vStart_S", M.start, { derivative: true });
|
|
677
|
+
const vWhile_S = makeState("vWhile_S", M.while_, { derivative: true });
|
|
678
|
+
const vWhen_S = makeState("vWhen_S", M.when, { derivative: true });
|
|
679
|
+
const vAsIf_S = makeState("vAsIf_S", M.asIf, { derivative: true });
|
|
680
|
+
const vSinceDoingSo_S = makeState("vSinceDoingSo_S", M.sinceDoingSo, { derivative: true });
|
|
681
|
+
const vAsLongAs_S = makeState("vAsLongAs_S", M.asLongAs, { derivative: true });
|
|
682
|
+
const vByDoingSo_S = makeState("vByDoingSo_S", M.byDoingSo, { derivative: true });
|
|
683
|
+
const vAdamantly_S = makeState("vAdamantly_S", M.adamantly, { derivative: true });
|
|
684
|
+
const vAfterDoing_S = makeState("vAfterDoing_S", M.afterDoingSo, { derivative: true });
|
|
685
|
+
const vWithoutHavingDoneSo_S = makeState("vWithoutHavingDoneSo_S", M.withoutHavingDoneSo, { derivative: true });
|
|
686
|
+
const vWithoutBeingAbleToHaveDoneSo_S = makeState("vWithoutBeingAbleToHaveDoneSo_S", M.withoutBeingAbleToHaveDoneSo, { derivative: true });
|
|
687
|
+
// --- Standalone Question (mı/mi/mu/mü) states ---
|
|
688
|
+
const questionRoot_S = makeState("questionRoot_S", M.ques, { posRoot: true });
|
|
689
|
+
const qPresent_S = makeState("qPresent_S", M.pres);
|
|
690
|
+
const qPast_S = makeState("qPast_S", M.past);
|
|
691
|
+
const qNarr_S = makeState("qNarr_S", M.narr);
|
|
692
|
+
const qA1sg_ST = makeState("qA1sg_ST", M.a1sg, { terminal: true });
|
|
693
|
+
const qA2sg_ST = makeState("qA2sg_ST", M.a2sg, { terminal: true });
|
|
694
|
+
const qA3sg_ST = makeState("qA3sg_ST", M.a3sg, { terminal: true });
|
|
695
|
+
const qA1pl_ST = makeState("qA1pl_ST", M.a1pl, { terminal: true });
|
|
696
|
+
const qA2pl_ST = makeState("qA2pl_ST", M.a2pl, { terminal: true });
|
|
697
|
+
const qA3pl_ST = makeState("qA3pl_ST", M.a3pl, { terminal: true });
|
|
698
|
+
const qCopBeforeA3pl_S = makeState("qCopBeforeA3pl_S", M.cop);
|
|
699
|
+
const qCop_ST = makeState("qCop_ST", M.cop, { terminal: true });
|
|
700
|
+
// --- Standalone Verb imek (idi, imiş, ise) states ---
|
|
701
|
+
const imekRoot_S = makeState("imekRoot_S", M.verb, { posRoot: true });
|
|
702
|
+
const imekPast_S = makeState("imekPast_S", M.past);
|
|
703
|
+
const imekNarr_S = makeState("imekNarr_S", M.narr);
|
|
704
|
+
const imekCond_S = makeState("imekCond_S", M.cond);
|
|
705
|
+
const imekA1sg_ST = makeState("imekA1sg_ST", M.a1sg, { terminal: true });
|
|
706
|
+
const imekA2sg_ST = makeState("imekA2sg_ST", M.a2sg, { terminal: true });
|
|
707
|
+
const imekA3sg_ST = makeState("imekA3sg_ST", M.a3sg, { terminal: true });
|
|
708
|
+
const imekA1pl_ST = makeState("imekA1pl_ST", M.a1pl, { terminal: true });
|
|
709
|
+
const imekA2pl_ST = makeState("imekA2pl_ST", M.a2pl, { terminal: true });
|
|
710
|
+
const imekA3pl_ST = makeState("imekA3pl_ST", M.a3pl, { terminal: true });
|
|
711
|
+
const imekCop_ST = makeState("imekCop_ST", M.cop, { terminal: true });
|
|
712
|
+
// =========================================================================
|
|
713
|
+
// 1. Noun States
|
|
714
|
+
// =========================================================================
|
|
715
|
+
const isCompoundOrInsertN = hasAttr(RA_COMPOUND_P3SG | RA_NOUN_CONS_INSERT_N);
|
|
716
|
+
const notCompoundOrInsertN = notHaveAttr(RA_COMPOUND_P3SG | RA_NOUN_CONS_INSERT_N);
|
|
717
|
+
const rootIsAbbrv = secondaryPosIs("Abbreviation");
|
|
718
|
+
const notFamily = notHaveAttr(RA_FAMILY_MEMBER);
|
|
719
|
+
const possessionCond = and(notFamily, not(rootIsAbbrv));
|
|
720
|
+
addEmpty(noun_S, a3sg_S, notHaveAttr(RA_IMPLICIT_PLURAL));
|
|
721
|
+
addTransition(noun_S, a3pl_S, "lAr", and(notHaveAttr(RA_IMPLICIT_PLURAL), notHaveAttr(RA_COMPOUND_P3SG)));
|
|
722
|
+
addEmpty(noun_S, a3pl_S, hasAttr(RA_IMPLICIT_PLURAL));
|
|
723
|
+
// Compound P3sg roots (e.g. "zeytinyağ" from "zeytinyağı")
|
|
724
|
+
addEmpty(nounCompoundRoot_S, a3sgCompound_S, hasAttr(RA_COMPOUND_P3SG_ROOT));
|
|
725
|
+
addEmpty(a3sgCompound_S, pnonCompound_S);
|
|
726
|
+
addTransition(a3sgCompound_S, p3pl_S, "lArI");
|
|
727
|
+
const containsNess = containsMorpheme(M.ness);
|
|
728
|
+
const notWithOrWithout = not(containsMorpheme(M.with, M.without));
|
|
729
|
+
addEmpty(pnonCompound_S, nom_S);
|
|
730
|
+
addTransition(nom_S, become_S, "lAş");
|
|
731
|
+
addTransition(nom_S, acquire_S, "lAn");
|
|
732
|
+
addTransition(nom_S, with_S, "lI", notWithOrWithout);
|
|
733
|
+
addTransition(nom_S, without_S, "sIz", notWithOrWithout);
|
|
734
|
+
addTransition(nom_S, ness_S, "lI~k", not(containsNess));
|
|
735
|
+
addTransition(nom_S, ness_S, "lI!ğ", not(containsNess));
|
|
736
|
+
addTransition(nom_S, agt_S, ">cI", not(containsMorpheme(M.agt)));
|
|
737
|
+
addTransition(nom_S, dash_S, ">dAş", not(containsMorpheme(M.dash)));
|
|
738
|
+
addTransition(nom_S, justLike_S, "+msI", not(containsMorpheme(M.justLike)));
|
|
739
|
+
addTransition(nom_S, dim_S, ">cI~k", and(hasNoSurface, not(containsMorpheme(M.dim))));
|
|
740
|
+
addTransition(nom_S, dim_S, ">cI!ğ", and(hasNoSurface, not(containsMorpheme(M.dim))));
|
|
741
|
+
addTransition(nom_S, dim_S, "cAğIz", hasNoSurface);
|
|
742
|
+
addTransition(nounCompoundRoot_S, a3plCompound_S, "lAr", hasAttr(RA_COMPOUND_P3SG_ROOT));
|
|
743
|
+
addTransition(nounCompoundRoot_S, a3plCompound2_S, "lArI", hasAttr(RA_COMPOUND_P3SG_ROOT));
|
|
744
|
+
addTransition(a3plCompound_S, p3sg_S, "I");
|
|
745
|
+
addTransition(a3plCompound_S, p2sg_S, "In");
|
|
746
|
+
addTransition(a3plCompound_S, p1sg_S, "Im");
|
|
747
|
+
addTransition(a3plCompound_S, p1pl_S, "ImIz");
|
|
748
|
+
addTransition(a3plCompound_S, p2pl_S, "InIz");
|
|
749
|
+
addTransition(a3plCompound_S, p3pl_S, "I");
|
|
750
|
+
addEmpty(a3plCompound2_S, pnonCompound2_S);
|
|
751
|
+
addEmpty(pnonCompound2_S, nom_ST);
|
|
752
|
+
// Regular A3sg -> Possessive
|
|
753
|
+
addEmpty(a3sg_S, pnon_S, notFamily);
|
|
754
|
+
addTransition(a3sg_S, p1sg_S, "Im", possessionCond);
|
|
755
|
+
addTransition(a3sg_S, p2sg_S, "In", and(possessionCond, not(prevGroupContainsMorpheme(M.justLike))));
|
|
756
|
+
addTransition(a3sg_S, p3sg_S, "+sI", and(possessionCond, notHaveAttr(RA_COMPOUND_P3SG)));
|
|
757
|
+
addEmpty(a3sg_S, p3sg_S, hasAttr(RA_COMPOUND_P3SG));
|
|
758
|
+
addTransition(a3sg_S, p1pl_S, "ImIz", possessionCond);
|
|
759
|
+
addTransition(a3sg_S, p2pl_S, "InIz", and(possessionCond, not(prevGroupContainsMorpheme(M.justLike))));
|
|
760
|
+
addTransition(a3sg_S, p3pl_S, "lArI", and(possessionCond, notHaveAttr(RA_COMPOUND_P3SG)));
|
|
761
|
+
// Regular A3pl -> Possessive
|
|
762
|
+
addEmpty(a3pl_S, pnon_S, notFamily);
|
|
763
|
+
addTransition(a3pl_S, p1sg_S, "Im", possessionCond);
|
|
764
|
+
addTransition(a3pl_S, p2sg_S, "In", possessionCond);
|
|
765
|
+
addEmpty(a3pl_S, p1sg_S, hasAttr(RA_IMPLICIT_P1SG));
|
|
766
|
+
addEmpty(a3pl_S, p2sg_S, hasAttr(RA_IMPLICIT_P2SG));
|
|
767
|
+
addTransition(a3pl_S, p3sg_S, "I", possessionCond);
|
|
768
|
+
addTransition(a3pl_S, p1pl_S, "ImIz", possessionCond);
|
|
769
|
+
addTransition(a3pl_S, p2pl_S, "InIz", possessionCond);
|
|
770
|
+
addTransition(a3pl_S, p3pl_S, "I", possessionCond);
|
|
771
|
+
// Special "su" / "akarsu" roots
|
|
772
|
+
addEmpty(nounSuRoot_S, a3sgSu_S);
|
|
773
|
+
addTransition(nounSuRoot_S, a3pl_S, "lar");
|
|
774
|
+
addEmpty(a3sgSu_S, pnon_S);
|
|
775
|
+
addTransition(a3sgSu_S, p1sg_S, "yum");
|
|
776
|
+
addTransition(a3sgSu_S, p2sg_S, "yun");
|
|
777
|
+
addTransition(a3sgSu_S, p3sg_S, "yu");
|
|
778
|
+
addTransition(a3sgSu_S, p1pl_S, "yumuz");
|
|
779
|
+
addTransition(a3sgSu_S, p2pl_S, "yunuz");
|
|
780
|
+
addTransition(a3sgSu_S, p3pl_S, "lArI");
|
|
781
|
+
// Possessive -> Case
|
|
782
|
+
const equCond = or(prevMorphemeIs(M.a3pl), not(containsMorpheme(M.adj, M.futPart, M.presPart, M.narrPart, M.pastPart)), containsMorphemeSeq(M.able, M.verb, M.pastPart));
|
|
783
|
+
const equWithPastPart = or(equCond, containsMorpheme(M.pastPart));
|
|
784
|
+
addEmpty(pnon_S, nom_ST, notFamily);
|
|
785
|
+
addTransition(pnon_S, dat_ST, "+yA", notCompoundOrInsertN);
|
|
786
|
+
addTransition(pnon_S, abl_ST, ">dAn", notCompoundOrInsertN);
|
|
787
|
+
// Prevent "daha + da" -> "*dahada" (clitic misspelling); "dahası" is lexicalized and "dahaki" uses nom_ST->rel_S.
|
|
788
|
+
addTransition(pnon_S, loc_ST, ">dA", and(notCompoundOrInsertN, rootKeyIsNot("daha_Noun_Time")));
|
|
789
|
+
addTransition(pnon_S, acc_ST, "+yI", notCompoundOrInsertN);
|
|
790
|
+
addTransition(pnon_S, gen_ST, "+nIn", prevStateIsNot(a3sgSu_S));
|
|
791
|
+
addTransition(pnon_S, gen_ST, "yIn", prevStateIs(a3sgSu_S));
|
|
792
|
+
addTransition(pnon_S, equ_ST, ">cA", and(notCompoundOrInsertN, equCond));
|
|
793
|
+
addTransition(pnon_S, ins_ST, "+ylA");
|
|
794
|
+
addTransition(pnon_S, dat_ST, "+nA", isCompoundOrInsertN);
|
|
795
|
+
addTransition(pnon_S, abl_ST, "+ndAn", isCompoundOrInsertN);
|
|
796
|
+
addTransition(pnon_S, loc_ST, "+ndA", isCompoundOrInsertN);
|
|
797
|
+
addTransition(pnon_S, equ_ST, "+ncA", and(isCompoundOrInsertN, equCond));
|
|
798
|
+
addTransition(pnon_S, acc_ST, "+nI", isCompoundOrInsertN);
|
|
799
|
+
addEmpty(pnon_S, dat_ST, hasAttr(RA_IMPLICIT_DATIVE));
|
|
800
|
+
for (const ps of [p1sg_S, p2sg_S, p1pl_S, p2pl_S]) {
|
|
801
|
+
addEmpty(ps, nom_ST);
|
|
802
|
+
addTransition(ps, dat_ST, "A");
|
|
803
|
+
addTransition(ps, loc_ST, "dA");
|
|
804
|
+
addTransition(ps, abl_ST, "dAn");
|
|
805
|
+
addTransition(ps, ins_ST, "lA");
|
|
806
|
+
addTransition(ps, gen_ST, "In");
|
|
807
|
+
addTransition(ps, equ_ST, "cA", equWithPastPart);
|
|
808
|
+
addTransition(ps, acc_ST, "I");
|
|
809
|
+
}
|
|
810
|
+
addEmpty(p3sg_S, nom_ST);
|
|
811
|
+
addTransition(p3sg_S, dat_ST, "nA");
|
|
812
|
+
addTransition(p3sg_S, loc_ST, "ndA");
|
|
813
|
+
addTransition(p3sg_S, abl_ST, "ndAn");
|
|
814
|
+
addTransition(p3sg_S, ins_ST, "ylA");
|
|
815
|
+
addTransition(p3sg_S, gen_ST, "nIn");
|
|
816
|
+
addTransition(p3sg_S, equ_ST, "ncA", equWithPastPart);
|
|
817
|
+
addTransition(p3sg_S, acc_ST, "nI");
|
|
818
|
+
addEmpty(p3pl_S, nom_ST);
|
|
819
|
+
addTransition(p3pl_S, dat_ST, "nA");
|
|
820
|
+
addTransition(p3pl_S, loc_ST, "ndA");
|
|
821
|
+
addTransition(p3pl_S, abl_ST, "ndAn");
|
|
822
|
+
addTransition(p3pl_S, ins_ST, "ylA");
|
|
823
|
+
addTransition(p3pl_S, gen_ST, "nIn");
|
|
824
|
+
addTransition(p3pl_S, equ_ST, "+ncA");
|
|
825
|
+
addTransition(p3pl_S, acc_ST, "nI");
|
|
826
|
+
// Derivations from nom_ST
|
|
827
|
+
const notAbbrv = not(rootIsAbbrv);
|
|
828
|
+
const emptyAdjNounSeq = containsMorphemeSeq(M.adj, M.zero, M.noun, M.a3sg, M.pnon, M.nom);
|
|
829
|
+
addTransition(nom_ST, dim_S, ">cI~k", and(hasNoSurface, notAbbrv));
|
|
830
|
+
addTransition(nom_ST, dim_S, ">cI!ğ", and(hasNoSurface, notAbbrv));
|
|
831
|
+
addTransition(nom_ST, dim_S, "cAğIz", and(hasNoSurface, notAbbrv));
|
|
832
|
+
addEmpty(dim_S, noun_S);
|
|
833
|
+
const nessCond = and(currentGroupEmpty, not(containsNess), not(emptyAdjNounSeq), notAbbrv);
|
|
834
|
+
addTransition(nom_ST, ness_S, "lI~k", nessCond);
|
|
835
|
+
addTransition(nom_ST, ness_S, "lI!ğ", nessCond);
|
|
836
|
+
addEmpty(ness_S, noun_S);
|
|
837
|
+
addTransition(nom_ST, agt_S, ">cI", and(currentGroupEmpty, not(containsMorpheme(M.adj, M.agt))));
|
|
838
|
+
addEmpty(agt_S, noun_S);
|
|
839
|
+
const verbDerivNoun = containsMorpheme(M.inf1, M.inf2, M.inf3, M.pastPart, M.futPart);
|
|
840
|
+
addTransition(nom_ST, dash_S, ">dAş", and(currentGroupEmpty, not(containsMorpheme(M.dash, M.adj, M.with, M.without, M.ness, M.agt, M.dim)), not(verbDerivNoun), notAbbrv));
|
|
841
|
+
addEmpty(dash_S, noun_S);
|
|
842
|
+
const noun2VerbCond = and(hasTail, not(and(currentGroupEmpty, lastDerivIs(adjZeroDeriv_S))));
|
|
843
|
+
for (const cs of [nom_ST, dat_ST, abl_ST, loc_ST, ins_ST, gen_ST]) {
|
|
844
|
+
addEmpty(cs, nounZeroDeriv_S, noun2VerbCond);
|
|
845
|
+
}
|
|
846
|
+
addEmpty(nounZeroDeriv_S, nVerb_S);
|
|
847
|
+
addTransition(nom_ST, with_S, "lI", and(currentGroupEmpty, notWithOrWithout));
|
|
848
|
+
addTransition(nom_ST, without_S, "sIz", and(currentGroupEmpty, not(containsMorpheme(M.with, M.without, M.inf1))));
|
|
849
|
+
const justLikeCond = and(currentGroupEmpty, not(containsMorpheme(M.justLike, M.futPart, M.pastPart, M.presPart, M.adj)), notAbbrv);
|
|
850
|
+
addTransition(nom_ST, justLike_S, "+msI", justLikeCond);
|
|
851
|
+
addTransition(nom_ST, justLike_S, "ImsI", and(notHavePhon(PA_LAST_VOWEL), justLikeCond));
|
|
852
|
+
addTransition(nom_ST, related_S, "sAl", and(currentGroupEmpty, not(containsMorpheme(M.with, M.without, M.related)), notAbbrv));
|
|
853
|
+
addEmpty(with_S, adjectiveRoot_ST);
|
|
854
|
+
addEmpty(without_S, adjectiveRoot_ST);
|
|
855
|
+
addEmpty(related_S, adjectiveRoot_ST);
|
|
856
|
+
addEmpty(justLike_S, adjectiveRoot_ST);
|
|
857
|
+
// -ki (Rel)
|
|
858
|
+
const notRelRepetition = not(hasTailSeq(M.rel, M.adj, M.zero, M.noun, M.a3sg, M.pnon, M.loc));
|
|
859
|
+
addTransition(loc_ST, rel_S, "ki", notRelRepetition);
|
|
860
|
+
addEmpty(rel_S, adjectiveRoot_ST);
|
|
861
|
+
// Allow pronominal -ki after locative ("evdekini", "elindekine", "evdekinde", "evdekinden").
|
|
862
|
+
addEmpty(rel_S, pronAfterRel_S, hasTail);
|
|
863
|
+
const isTime = and(currentGroupEmpty, secondaryPosIs("Time"));
|
|
864
|
+
const isDunGunBugun = rootKeyIn(["dün_Noun_Time", "gün_Noun_Time", "bugün_Noun_Time"]);
|
|
865
|
+
const isDirKi = rootKeyIn(["ileri_Noun", "geri_Noun", "öte_Noun", "beri_Noun"]);
|
|
866
|
+
addTransition(nom_ST, rel_S, "ki", and(isTime, not(isDunGunBugun)));
|
|
867
|
+
addTransition(nom_ST, rel_S, "ki", and(currentGroupEmpty, isDirKi));
|
|
868
|
+
addTransition(nom_ST, rel_S, "kü", and(isTime, isDunGunBugun));
|
|
869
|
+
addTransition(gen_ST, relToPron_S, "ki");
|
|
870
|
+
addEmpty(relToPron_S, pronAfterRel_S);
|
|
871
|
+
const becomeAcquireCond = and(currentGroupEmpty, not(containsMorpheme(M.adj)), not(verbDerivNoun), notAbbrv);
|
|
872
|
+
addTransition(nom_ST, become_S, "lAş", becomeAcquireCond);
|
|
873
|
+
addEmpty(become_S, verbRoot_S);
|
|
874
|
+
addTransition(nom_ST, acquire_S, "lAn", becomeAcquireCond);
|
|
875
|
+
addEmpty(acquire_S, verbRoot_S);
|
|
876
|
+
// Inf1 (-mAk) noun path
|
|
877
|
+
addEmpty(nounInf1Root_S, a3sgInf1_S);
|
|
878
|
+
addEmpty(a3sgInf1_S, pnonInf1_S);
|
|
879
|
+
addEmpty(pnonInf1_S, nom_ST);
|
|
880
|
+
addTransition(pnonInf1_S, abl_ST, "tAn");
|
|
881
|
+
addTransition(pnonInf1_S, loc_ST, "tA");
|
|
882
|
+
addTransition(pnonInf1_S, ins_ST, "lA");
|
|
883
|
+
// ActOf (-mAcA) noun path
|
|
884
|
+
addEmpty(nounActOfRoot_S, a3sgActOf_S);
|
|
885
|
+
addTransition(nounActOfRoot_S, a3plActOf_S, "lar");
|
|
886
|
+
addEmpty(a3sgActOf_S, pnonActOf_S);
|
|
887
|
+
addEmpty(a3plActOf_S, pnonActOf_S);
|
|
888
|
+
addEmpty(pnonActOf_S, nom_ST);
|
|
889
|
+
// Proper nouns, abbreviations, and NoSuffix nouns
|
|
890
|
+
addEmpty(nounProper_S, a3sg_S);
|
|
891
|
+
addTransition(nounProper_S, a3pl_S, "lAr");
|
|
892
|
+
addEmpty(nounAbbrv_S, a3sg_S);
|
|
893
|
+
addTransition(nounAbbrv_S, a3pl_S, "lAr");
|
|
894
|
+
addEmpty(nounNoSuffix_S, nounA3sgNoSuffix_S);
|
|
895
|
+
addEmpty(nounA3sgNoSuffix_S, nounPnonNoSuffix_S);
|
|
896
|
+
addEmpty(nounPnonNoSuffix_S, nounNomNoSuffix_ST);
|
|
897
|
+
// =========================================================================
|
|
898
|
+
// 2. Adjective States
|
|
899
|
+
// =========================================================================
|
|
900
|
+
const isNominalizableAdj = (p) => !(p.stemTransition.item.primaryPos === "Adj" && NON_NOMINALIZABLE_ADJ_LEMMAS.has(p.stemTransition.item.root));
|
|
901
|
+
addEmpty(adjectiveRoot_ST, adjZeroDeriv_S, hasTail);
|
|
902
|
+
// After -ki (rel_S), nominal case/plural inflections go through pronAfterRel_S (evdekini, evdekiler),
|
|
903
|
+
// preventing ungrammatical non-buffer forms like *evdekiyi, *evdekide.
|
|
904
|
+
addEmpty(adjZeroDeriv_S, noun_S, and(isNominalizableAdj, not(hasTailSeq(M.rel, M.adj, M.zero))));
|
|
905
|
+
addEmpty(adjZeroDeriv_S, nVerb_S);
|
|
906
|
+
addTransition(adjectiveRoot_ST, aLy_S, ">cA");
|
|
907
|
+
addEmpty(aLy_S, advRoot_ST);
|
|
908
|
+
const notAdjDerivRepeat = not(containsMorpheme(M.asIf, M.ly, M.agt, M.with, M.justLike));
|
|
909
|
+
addTransition(adjectiveRoot_ST, aAsIf_S, ">cA", notAdjDerivRepeat);
|
|
910
|
+
addEmpty(aAsIf_S, adjectiveRoot_ST);
|
|
911
|
+
addTransition(adjectiveRoot_ST, aAgt_S, ">cI", notAdjDerivRepeat);
|
|
912
|
+
addEmpty(aAgt_S, noun_S);
|
|
913
|
+
const adjJustLikeCond = and(currentGroupEmpty, not(containsMorpheme(M.justLike)));
|
|
914
|
+
addTransition(adjectiveRoot_ST, justLike_S, "+msI", adjJustLikeCond);
|
|
915
|
+
addTransition(adjectiveRoot_ST, justLike_S, "ImsI", and(notHavePhon(PA_LAST_VOWEL), adjJustLikeCond));
|
|
916
|
+
addTransition(adjectiveRoot_ST, become_S, "lAş", currentGroupEmpty);
|
|
917
|
+
addTransition(adjectiveRoot_ST, acquire_S, "lAn", currentGroupEmpty);
|
|
918
|
+
const afterFutOrPastPart = prevMorphemeIn([M.futPart, M.pastPart]);
|
|
919
|
+
addEmpty(adjAfterVerb_S, aPnon_ST, afterFutOrPastPart);
|
|
920
|
+
addTransition(adjAfterVerb_S, aP1sg_ST, "Im", afterFutOrPastPart);
|
|
921
|
+
addTransition(adjAfterVerb_S, aP2sg_ST, "In", afterFutOrPastPart);
|
|
922
|
+
addTransition(adjAfterVerb_S, aP3sg_ST, "I", afterFutOrPastPart);
|
|
923
|
+
addTransition(adjAfterVerb_S, aP1pl_ST, "ImIz", afterFutOrPastPart);
|
|
924
|
+
addTransition(adjAfterVerb_S, aP2pl_ST, "InIz", afterFutOrPastPart);
|
|
925
|
+
addTransition(adjAfterVerb_S, aP3pl_ST, "lArI", afterFutOrPastPart);
|
|
926
|
+
addTransition(adjectiveRoot_ST, ness_S, "lI~k");
|
|
927
|
+
addTransition(adjectiveRoot_ST, ness_S, "lI!ğ");
|
|
928
|
+
addTransition(adjAfterVerb_ST, ness_S, "lI~k", prevMorphemeIs(M.aorPart));
|
|
929
|
+
addTransition(adjAfterVerb_ST, ness_S, "lI!ğ", prevMorphemeIs(M.aorPart));
|
|
930
|
+
// bilmezden, görmezden
|
|
931
|
+
addEmpty(adjAfterVerb_ST, aorPartNegZero_S, prevStateIs(vAorPartNeg_S));
|
|
932
|
+
addEmpty(aorPartNegZero_S, aorPartNegNoun_S);
|
|
933
|
+
addEmpty(aorPartNegNoun_S, aorPartNegA3sg_S);
|
|
934
|
+
addEmpty(aorPartNegA3sg_S, aorPartNegPnon_S);
|
|
935
|
+
addTransition(aorPartNegPnon_S, aorPartNegAbl_ST, "dAn");
|
|
936
|
+
// =========================================================================
|
|
937
|
+
// 3. Numeral States
|
|
938
|
+
// =========================================================================
|
|
939
|
+
addTransition(numeralRoot_ST, ness_S, "lI~k");
|
|
940
|
+
addTransition(numeralRoot_ST, ness_S, "lI!ğ");
|
|
941
|
+
addEmpty(numeralRoot_ST, numZeroDeriv_S, hasTail);
|
|
942
|
+
addEmpty(numZeroDeriv_S, noun_S);
|
|
943
|
+
addEmpty(numZeroDeriv_S, nVerb_S);
|
|
944
|
+
addTransition(numeralRoot_ST, justLike_S, "+msI", adjJustLikeCond);
|
|
945
|
+
addTransition(numeralRoot_ST, justLike_S, "ImsI", and(notHavePhon(PA_LAST_VOWEL), adjJustLikeCond));
|
|
946
|
+
// =========================================================================
|
|
947
|
+
// 4. Nominal Predicate (Ek-Fiil) States
|
|
948
|
+
// =========================================================================
|
|
949
|
+
addEmpty(nVerb_S, nPresent_S);
|
|
950
|
+
addTransition(nVerb_S, nPast_S, "+y>dI");
|
|
951
|
+
addTransition(nVerb_S, nNarr_S, "+ymIş");
|
|
952
|
+
addTransition(nVerb_S, nCond_S, "+ysA");
|
|
953
|
+
addTransition(nVerb_S, vWhile_S, "+yken", not(hasTailSeq(M.narrPart, M.adj, M.zero, M.verb)));
|
|
954
|
+
const isDegil = rootKeyIs("değil_Verb");
|
|
955
|
+
addEmpty(nVerbDegil_S, nNeg_S, isDegil);
|
|
956
|
+
copyOutgoing(nNeg_S, nVerb_S);
|
|
957
|
+
const nVerbBlockedDeriv = or(containsMorpheme(M.inf1), and(containsMorpheme(M.inf2, M.inf3, M.pastPart, M.futPart, M.feelLike), not(prevGroupContains(loc_ST, abl_ST, ins_ST))));
|
|
958
|
+
const allowA1sg = and(notFamily, not(containsMorphemeSeq(M.p1sg, M.nom)), not(nVerbBlockedDeriv));
|
|
959
|
+
const allowA2sg = and(notFamily, not(containsMorphemeSeq(M.p2sg, M.nom)), not(nVerbBlockedDeriv));
|
|
960
|
+
const allowA3pl = and(notFamily, not(prevGroupContains(a3pl_S)), not(containsMorphemeSeq(M.p3pl, M.nom)), not(nVerbBlockedDeriv));
|
|
961
|
+
const allowA2pl = and(notFamily, not(containsMorphemeSeq(M.p2pl, M.nom)), not(nVerbBlockedDeriv));
|
|
962
|
+
const allowA1pl = and(notFamily, not(containsMorphemeSeq(M.p1sg, M.nom)), not(containsMorphemeSeq(M.p1pl, M.nom)), not(nVerbBlockedDeriv));
|
|
963
|
+
addTransition(nPresent_S, nA1sg_ST, "+yIm", allowA1sg);
|
|
964
|
+
addTransition(nPresent_S, nA2sg_ST, "sIn", allowA2sg);
|
|
965
|
+
addEmpty(nPresent_S, nA3sg_S);
|
|
966
|
+
addEmpty(nPresent_S, nA3sg_ST, isDegil);
|
|
967
|
+
addTransition(nPresent_S, nA3pl_ST, "lAr", and(notHaveAttr(RA_COMPOUND_P3SG), not(prevGroupContainsMorpheme(M.inf1)), allowA3pl));
|
|
968
|
+
addTransition(nPresent_S, nA1pl_ST, "+yIz", allowA1pl);
|
|
969
|
+
addTransition(nPresent_S, nA2pl_ST, "sInIz", allowA2pl);
|
|
970
|
+
addTransition(nPast_S, nA1sg_ST, "m", allowA1sg);
|
|
971
|
+
addTransition(nPast_S, nA2sg_ST, "n", allowA2sg);
|
|
972
|
+
addTransition(nPast_S, nA1pl_ST, "k", allowA1pl);
|
|
973
|
+
addTransition(nPast_S, nA2pl_ST, "InIz", allowA2pl);
|
|
974
|
+
addTransition(nPast_S, nA3pl_ST, "lAr", and(notHaveAttr(RA_COMPOUND_P3SG), allowA3pl));
|
|
975
|
+
addEmpty(nPast_S, nA3sg_ST);
|
|
976
|
+
addTransition(nNarr_S, nA1sg_ST, "Im", allowA1sg);
|
|
977
|
+
addTransition(nNarr_S, nA2sg_ST, "sIn", allowA2sg);
|
|
978
|
+
addTransition(nNarr_S, nA1pl_ST, "Iz", allowA1pl);
|
|
979
|
+
addTransition(nNarr_S, nA2pl_ST, "sInIz", allowA2pl);
|
|
980
|
+
addTransition(nNarr_S, nA3pl_ST, "lAr", and(notHaveAttr(RA_COMPOUND_P3SG), allowA3pl));
|
|
981
|
+
addEmpty(nNarr_S, nA3sg_ST);
|
|
982
|
+
addTransition(nNarr_S, nCond_S, "sA");
|
|
983
|
+
addTransition(nCond_S, nA1sg_ST, "m", allowA1sg);
|
|
984
|
+
addTransition(nCond_S, nA2sg_ST, "n", allowA2sg);
|
|
985
|
+
addTransition(nCond_S, nA1pl_ST, "k", allowA1pl);
|
|
986
|
+
addTransition(nCond_S, nA2pl_ST, "nIz", allowA2pl);
|
|
987
|
+
addEmpty(nCond_S, nA3sg_ST);
|
|
988
|
+
addTransition(nCond_S, nA3pl_ST, "lAr");
|
|
989
|
+
const nRejectNoCopula = not(currentGroupContains(nPast_S, nCond_S, nCopBeforeA3pl_S));
|
|
990
|
+
addTransition(nA1sg_ST, nCop_ST, "dIr", nRejectNoCopula);
|
|
991
|
+
addTransition(nA2sg_ST, nCop_ST, "dIr", nRejectNoCopula);
|
|
992
|
+
addTransition(nA1pl_ST, nCop_ST, "dIr", nRejectNoCopula);
|
|
993
|
+
addTransition(nA2pl_ST, nCop_ST, "dIr", nRejectNoCopula);
|
|
994
|
+
addTransition(nA3sg_S, nCop_ST, ">dIr", nRejectNoCopula);
|
|
995
|
+
addTransition(nA3pl_ST, nCop_ST, "dIr", nRejectNoCopula);
|
|
996
|
+
const afterNarr = prevMorphemeIs(M.narr);
|
|
997
|
+
for (const s of [nA3sg_ST, nA1sg_ST, nA2sg_ST, nA1pl_ST, nA2pl_ST, nA3pl_ST]) {
|
|
998
|
+
addTransition(s, vAsIf_S, ">cAsInA", afterNarr);
|
|
999
|
+
}
|
|
1000
|
+
const nA3plAfterCase = and(prevStateIs(nPresent_S), prevGroupContains(loc_ST, abl_ST, dat_ST, ins_ST));
|
|
1001
|
+
addTransition(nA3pl_ST, vPastAfterTense_ST, "dI", nA3plAfterCase);
|
|
1002
|
+
addTransition(nA3pl_ST, vNarrAfterTense_ST, "mIş", nA3plAfterCase);
|
|
1003
|
+
addTransition(nA3pl_ST, vCond_ST, "sA", nA3plAfterCase);
|
|
1004
|
+
addTransition(nA3pl_ST, vWhile_S, "ken", nA3plAfterCase);
|
|
1005
|
+
addTransition(nPresent_S, nCopBeforeA3pl_S, ">dIr");
|
|
1006
|
+
addTransition(nCopBeforeA3pl_S, nA3pl_ST, "lAr", and(notHaveAttr(RA_COMPOUND_P3SG), allowA3pl));
|
|
1007
|
+
// =========================================================================
|
|
1008
|
+
// 5. Pronoun States
|
|
1009
|
+
// =========================================================================
|
|
1010
|
+
const BEN = "ben_Pron_PersonalPron";
|
|
1011
|
+
const SEN = "sen_Pron_PersonalPron";
|
|
1012
|
+
const O_PERS = "o_Pron_PersonalPron";
|
|
1013
|
+
const BIZ = "biz_Pron_PersonalPron";
|
|
1014
|
+
const SIZ = "siz_Pron_PersonalPron";
|
|
1015
|
+
const FALAN = "falan_Pron_PersonalPron";
|
|
1016
|
+
const FALANCA = "falanca_Pron_PersonalPron";
|
|
1017
|
+
const BU = "bu_Pron_DemonstrativePron";
|
|
1018
|
+
const SU = "şu_Pron_DemonstrativePron";
|
|
1019
|
+
const O_DEMONS = "o_Pron_DemonstrativePron";
|
|
1020
|
+
const BIRBIRI = "birbiri_Pron_QuantitivePron";
|
|
1021
|
+
const BIRI = "biri_Pron_QuantitivePron";
|
|
1022
|
+
const BAZI = "bazı_Pron_QuantitivePron";
|
|
1023
|
+
const BIRCOGU = "birçoğu_Pron_QuantitivePron";
|
|
1024
|
+
const BIRKACI = "birkaçı_Pron_QuantitivePron";
|
|
1025
|
+
const BERIKI = "beriki_Pron_QuantitivePron";
|
|
1026
|
+
const COGU = "çoğu_Pron_QuantitivePron";
|
|
1027
|
+
const CUMLESI = "cümlesi_Pron_QuantitivePron";
|
|
1028
|
+
const HEP = "hep_Pron_QuantitivePron";
|
|
1029
|
+
const HERBIRI = "herbiri_Pron_QuantitivePron";
|
|
1030
|
+
const HERKES = "herkes_Pron_QuantitivePron";
|
|
1031
|
+
const HICBIRI = "hiçbiri_Pron_QuantitivePron";
|
|
1032
|
+
const HEPSI = "hepsi_Pron_QuantitivePron";
|
|
1033
|
+
const KIMI = "kimi_Pron_QuantitivePron";
|
|
1034
|
+
const KIMSE = "kimse_Pron_QuantitivePron";
|
|
1035
|
+
const OBURKU = "öbürkü_Pron_QuantitivePron";
|
|
1036
|
+
const OBURU = "öbürü_Pron_QuantitivePron";
|
|
1037
|
+
const TUMU = "tümü_Pron_QuantitivePron";
|
|
1038
|
+
const TOPU = "topu_Pron_QuantitivePron";
|
|
1039
|
+
const UMUM_QUANT = "umum_Pron_QuantitivePron";
|
|
1040
|
+
const UMUM_PLAIN = "umum_Pron";
|
|
1041
|
+
const NE = "ne_Pron_QuestionPron";
|
|
1042
|
+
const NERE = "nere_Pron_QuestionPron";
|
|
1043
|
+
const KIM = "kim_Pron_QuestionPron";
|
|
1044
|
+
const HANGI = "hangi_Pron_QuestionPron";
|
|
1045
|
+
const KENDI = "kendi_Pron_ReflexivePron";
|
|
1046
|
+
addEmpty(pronPers_S, pA1sg_S, rootKeyIs(BEN));
|
|
1047
|
+
addEmpty(pronPers_S, pA2sg_S, rootKeyIs(SEN));
|
|
1048
|
+
addEmpty(pronPers_S, pA3sg_S, rootKeyIn([O_PERS, FALAN, FALANCA]));
|
|
1049
|
+
addTransition(pronPers_S, pA3pl_S, "nlAr", rootKeyIs(O_PERS));
|
|
1050
|
+
addTransition(pronPers_S, pA3pl_S, "lAr", rootKeyIn([FALAN, FALANCA]));
|
|
1051
|
+
addEmpty(pronPers_S, pA1pl_S, rootKeyIs(BIZ));
|
|
1052
|
+
addTransition(pronPers_S, pA1pl_S, "lAr", rootKeyIs(BIZ));
|
|
1053
|
+
addEmpty(pronPers_S, pA2pl_S, rootKeyIs(SIZ));
|
|
1054
|
+
addTransition(pronPers_S, pA2pl_S, "lAr", rootKeyIs(SIZ));
|
|
1055
|
+
// Modified ben/sen -> ban-a, san-a
|
|
1056
|
+
addEmpty(pronPers_Mod_S, pA1sgMod_S, rootKeyIs(BEN));
|
|
1057
|
+
addEmpty(pronPers_Mod_S, pA2sgMod_S, rootKeyIs(SEN));
|
|
1058
|
+
addEmpty(pA1sgMod_S, pPnonMod_S);
|
|
1059
|
+
addEmpty(pA2sgMod_S, pPnonMod_S);
|
|
1060
|
+
addTransition(pPnonMod_S, pDat_ST, "A");
|
|
1061
|
+
for (const s of [pA1sg_S, pA2sg_S, pA3sg_S, pA1pl_S, pA2pl_S, pA3pl_S]) {
|
|
1062
|
+
addEmpty(s, pPnon_S);
|
|
1063
|
+
}
|
|
1064
|
+
// Noun -> Rel -> Pron (masanınki, evdekini, evdekiler)
|
|
1065
|
+
addEmpty(pronAfterRel_S, pA3sgRel_S);
|
|
1066
|
+
addTransition(pronAfterRel_S, pA3plRel_S, "lAr");
|
|
1067
|
+
addEmpty(pA3sgRel_S, pPnonRel_S);
|
|
1068
|
+
addEmpty(pA3plRel_S, pPnonRel_S);
|
|
1069
|
+
addEmpty(pPnonRel_S, pNom_ST);
|
|
1070
|
+
addTransition(pPnonRel_S, pDat_ST, "+nA");
|
|
1071
|
+
addTransition(pPnonRel_S, pAcc_ST, "+nI");
|
|
1072
|
+
addTransition(pPnonRel_S, pAbl_ST, "+ndAn");
|
|
1073
|
+
addTransition(pPnonRel_S, pLoc_ST, "+ndA");
|
|
1074
|
+
addTransition(pPnonRel_S, pIns_ST, "+ylA");
|
|
1075
|
+
addTransition(pPnonRel_S, pGen_ST, "+nIn");
|
|
1076
|
+
// Demonstrative pronouns (bu, şu, o)
|
|
1077
|
+
addEmpty(pronDemons_S, pA3sg_S);
|
|
1078
|
+
addTransition(pronDemons_S, pA3pl_S, "nlAr");
|
|
1079
|
+
// Quantitive pronouns
|
|
1080
|
+
addEmpty(pronQuant_S, pQuantA3sg_S, rootKeyNotIn([HERKES, UMUM_QUANT, UMUM_PLAIN, HEPSI, CUMLESI, HEP, TUMU, BIRKACI, TOPU]));
|
|
1081
|
+
addTransition(pronQuant_S, pQuantA3pl_S, "lAr", rootKeyNotIn([HEP, HEPSI, BIRKACI, UMUM_QUANT, UMUM_PLAIN, CUMLESI, COGU, BIRCOGU, HERBIRI, TUMU, HICBIRI, TOPU, OBURU]));
|
|
1082
|
+
addTransition(pronQuant_S, pQuantA1pl_S, "lAr", rootKeyIs(BAZI));
|
|
1083
|
+
addTransition(pronQuant_S, pQuantA2pl_S, "lAr", rootKeyIs(BAZI));
|
|
1084
|
+
addEmpty(pronQuant_S, pQuantA3pl_S, rootKeyIn([HERKES, UMUM_QUANT, UMUM_PLAIN, BIRKACI, HEPSI, CUMLESI, COGU, BIRCOGU, TUMU, TOPU]));
|
|
1085
|
+
addEmpty(pronQuant_S, a3sg_S, rootKeyIs(KIMSE));
|
|
1086
|
+
addTransition(pronQuant_S, a3pl_S, "lAr", rootKeyIs(KIMSE));
|
|
1087
|
+
const quantPl12Roots = rootKeyIn([BIRI, BAZI, BIRBIRI, BIRKACI, HERBIRI, HEP, KIMI, COGU, BIRCOGU, TUMU, TOPU, HICBIRI]);
|
|
1088
|
+
addEmpty(pronQuant_S, pQuantA1pl_S, quantPl12Roots);
|
|
1089
|
+
addEmpty(pronQuant_S, pQuantA2pl_S, quantPl12Roots);
|
|
1090
|
+
addEmpty(pronQuantModified_S, pQuantModA3pl_S);
|
|
1091
|
+
addTransition(pQuantModA3pl_S, pP3pl_S, "lArI");
|
|
1092
|
+
const notModPron = notHavePhon(PA_MODIFIED_PRONOUN);
|
|
1093
|
+
const plainVowelPron = and(secondaryPosIs("None"), hasPhon(PA_LAST_VOWEL));
|
|
1094
|
+
addEmpty(pQuantA3sg_S, pP3sg_S, and(or(rootKeyIn([BIRI, BIRBIRI, KIMI, HERBIRI, HICBIRI, OBURU, OBURKU, BERIKI]), plainVowelPron), notModPron));
|
|
1095
|
+
addTransition(pQuantA3sg_S, pP3sg_S, "sI", and(rootKeyIn([BIRI, BAZI, KIMI, BIRBIRI, HERBIRI, HICBIRI, OBURKU]), notModPron));
|
|
1096
|
+
addTransition(pQuantA3pl_S, pP3pl_S, "I", rootKeyIn([BIRI, BAZI, BIRBIRI, KIMI, OBURKU, BERIKI]));
|
|
1097
|
+
addEmpty(pQuantA3pl_S, pP3pl_S, rootKeyIn([HEPSI, BIRKACI, CUMLESI, COGU, TUMU, TOPU, BIRCOGU]));
|
|
1098
|
+
addEmpty(pQuantA3pl_S, pPnon_S, rootKeyIn([HERKES, UMUM_QUANT, UMUM_PLAIN, OBURKU, BERIKI]));
|
|
1099
|
+
addTransition(pQuantA1pl_S, pP1pl_S, "ImIz");
|
|
1100
|
+
addTransition(pQuantA2pl_S, pP2pl_S, "InIz");
|
|
1101
|
+
// Question pronouns (kim, ne, nere, hangi)
|
|
1102
|
+
addEmpty(pronQues_S, pQuesA3sg_S);
|
|
1103
|
+
addTransition(pronQues_S, pQuesA3pl_S, "lAr");
|
|
1104
|
+
addEmpty(pQuesA3sg_S, pPnon_S);
|
|
1105
|
+
addTransition(pQuesA3sg_S, pP3sg_S, "+sI");
|
|
1106
|
+
addTransition(pQuesA3sg_S, pP1sg_S, "Im", rootKeyIsNot(NE));
|
|
1107
|
+
addTransition(pQuesA3sg_S, pP1sg_S, "yIm", rootKeyIs(NE));
|
|
1108
|
+
addTransition(pQuesA3sg_S, pP2sg_S, "In", rootKeyIsNot(NE));
|
|
1109
|
+
addTransition(pQuesA3sg_S, pP2sg_S, "yIn", rootKeyIs(NE));
|
|
1110
|
+
addTransition(pQuesA3sg_S, pP1pl_S, "ImIz", rootKeyIsNot(NE));
|
|
1111
|
+
addTransition(pQuesA3sg_S, pP1pl_S, "yImIz", rootKeyIs(NE));
|
|
1112
|
+
addTransition(pQuesA3sg_S, pP2pl_S, "InIz", rootKeyIsNot(NE));
|
|
1113
|
+
addTransition(pQuesA3sg_S, pP2pl_S, "yInIz", rootKeyIs(NE));
|
|
1114
|
+
addEmpty(pQuesA3pl_S, pPnon_S);
|
|
1115
|
+
addTransition(pQuesA3pl_S, pP3sg_S, "I");
|
|
1116
|
+
addTransition(pQuesA3pl_S, pP1sg_S, "Im");
|
|
1117
|
+
addTransition(pQuesA3pl_S, pP2sg_S, "In");
|
|
1118
|
+
addTransition(pQuesA3pl_S, pP1pl_S, "ImIz");
|
|
1119
|
+
addTransition(pQuesA3pl_S, pP2pl_S, "InIz");
|
|
1120
|
+
// Reflexive pronoun (kendi)
|
|
1121
|
+
addEmpty(pronReflex_S, pReflexA1sg_S);
|
|
1122
|
+
addEmpty(pronReflex_S, pReflexA2sg_S);
|
|
1123
|
+
addEmpty(pronReflex_S, pReflexA3sg_S);
|
|
1124
|
+
addEmpty(pronReflex_S, pReflexA1pl_S);
|
|
1125
|
+
addEmpty(pronReflex_S, pReflexA2pl_S);
|
|
1126
|
+
addEmpty(pronReflex_S, pReflexA3pl_S);
|
|
1127
|
+
addTransition(pReflexA1sg_S, pP1sg_S, "Im");
|
|
1128
|
+
addTransition(pReflexA2sg_S, pP2sg_S, "In");
|
|
1129
|
+
addTransition(pReflexA3sg_S, pP3sg_S, "+sI");
|
|
1130
|
+
addEmpty(pReflexA3sg_S, pP3sg_S);
|
|
1131
|
+
addTransition(pReflexA1pl_S, pP1pl_S, "ImIz");
|
|
1132
|
+
addTransition(pReflexA2pl_S, pP2pl_S, "InIz");
|
|
1133
|
+
addTransition(pReflexA3pl_S, pP3pl_S, "lArI");
|
|
1134
|
+
// Case transitions for pronouns
|
|
1135
|
+
const yKeys = [NE, NERE, FALAN, FALANCA, HEP, HERKES];
|
|
1136
|
+
const nGroup = rootKeyNotIn(yKeys);
|
|
1137
|
+
const yGroup = rootKeyIn(yKeys);
|
|
1138
|
+
addEmpty(pPnon_S, pNom_ST);
|
|
1139
|
+
addTransition(pPnon_S, pDat_ST, "+nA", rootKeyNotIn([BEN, SEN, NE, NERE, FALAN, FALANCA, HERKES]));
|
|
1140
|
+
addTransition(pPnon_S, pDat_ST, "+yA", yGroup);
|
|
1141
|
+
addTransition(pPnon_S, pAcc_ST, "+nI", nGroup);
|
|
1142
|
+
addTransition(pPnon_S, pAcc_ST, "+yI", yGroup);
|
|
1143
|
+
addTransition(pPnon_S, pLoc_ST, "+ndA", nGroup);
|
|
1144
|
+
addTransition(pPnon_S, pLoc_ST, ">dA", yGroup);
|
|
1145
|
+
addTransition(pPnon_S, pAbl_ST, "+ndAn", nGroup);
|
|
1146
|
+
addTransition(pPnon_S, pAbl_ST, ">dAn", yGroup);
|
|
1147
|
+
addTransition(pPnon_S, pGen_ST, "+nIn", and(nGroup, not(and(rootKeyIn([BIZ, BEN, SEN]), hasNoSurface))));
|
|
1148
|
+
addTransition(pPnon_S, pGen_ST, "im", and(rootKeyIn([BEN, BIZ]), hasNoSurface));
|
|
1149
|
+
addTransition(pPnon_S, pGen_ST, "in", and(rootKeyIs(SEN), hasNoSurface));
|
|
1150
|
+
addTransition(pPnon_S, pGen_ST, "+yIn", and(yGroup, rootKeyIsNot(BIZ)));
|
|
1151
|
+
addTransition(pPnon_S, pEqu_ST, ">cA");
|
|
1152
|
+
addTransition(pPnon_S, pIns_ST, "+ylA", yGroup);
|
|
1153
|
+
addTransition(pPnon_S, pIns_ST, "+nlA", nGroup);
|
|
1154
|
+
addTransition(pPnon_S, pIns_ST, "+nInlA", and(nGroup, rootKeyIn([BU, SU, O_PERS, O_DEMONS, SEN]), hasNoSurface));
|
|
1155
|
+
addTransition(pPnon_S, pIns_ST, "inle", and(rootKeyIs(SIZ), hasNoSurface));
|
|
1156
|
+
addTransition(pPnon_S, pIns_ST, "imle", and(rootKeyIn([BIZ, BEN]), hasNoSurface));
|
|
1157
|
+
const p1sgPronCond = rootKeyIn([KIM, BEN, NE, NERE, KENDI]);
|
|
1158
|
+
addEmpty(pP1sg_S, pNom_ST);
|
|
1159
|
+
addTransition(pP1sg_S, pDat_ST, "+nA", nGroup);
|
|
1160
|
+
addTransition(pP1sg_S, pAcc_ST, "+nI", nGroup);
|
|
1161
|
+
addTransition(pP1sg_S, pDat_ST, "+yA", yGroup);
|
|
1162
|
+
addTransition(pP1sg_S, pAcc_ST, "+yI", yGroup);
|
|
1163
|
+
addTransition(pP1sg_S, pLoc_ST, "+ndA", rootKeyIs(KENDI));
|
|
1164
|
+
addTransition(pP1sg_S, pAbl_ST, "+ndAn", rootKeyIs(KENDI));
|
|
1165
|
+
addTransition(pP1sg_S, pEqu_ST, "+ncA", rootKeyIs(KENDI));
|
|
1166
|
+
addTransition(pP1sg_S, pIns_ST, "+nlA", p1sgPronCond);
|
|
1167
|
+
addTransition(pP1sg_S, pGen_ST, "+nIn", p1sgPronCond);
|
|
1168
|
+
const p2sgPronCond = rootKeyIn([KIM, SEN, NE, NERE, KENDI]);
|
|
1169
|
+
addEmpty(pP2sg_S, pNom_ST);
|
|
1170
|
+
addTransition(pP2sg_S, pDat_ST, "+nA", nGroup);
|
|
1171
|
+
addTransition(pP2sg_S, pAcc_ST, "+nI", nGroup);
|
|
1172
|
+
addTransition(pP2sg_S, pDat_ST, "+yA", yGroup);
|
|
1173
|
+
addTransition(pP2sg_S, pAcc_ST, "+yI", yGroup);
|
|
1174
|
+
addTransition(pP2sg_S, pLoc_ST, "+ndA", rootKeyIs(KENDI));
|
|
1175
|
+
addTransition(pP2sg_S, pAbl_ST, "+ndAn", rootKeyIs(KENDI));
|
|
1176
|
+
addTransition(pP2sg_S, pEqu_ST, "+ncA", rootKeyIs(KENDI));
|
|
1177
|
+
addTransition(pP2sg_S, pIns_ST, "+nlA", p2sgPronCond);
|
|
1178
|
+
addTransition(pP2sg_S, pGen_ST, "+nIn", p2sgPronCond);
|
|
1179
|
+
const p3sgPronCond = or(rootKeyIn([KENDI, KIM, NE, NERE, O_PERS, BAZI, BIRI, BIRBIRI, HERBIRI, HEP, KIMI, HICBIRI, HANGI]), plainVowelPron);
|
|
1180
|
+
addEmpty(pP3sg_S, pNom_ST);
|
|
1181
|
+
// After 3rd-person possessive (-sI/-I), all pronouns take buffer -n- (nesine, nesini, neresini, kendisine).
|
|
1182
|
+
addTransition(pP3sg_S, pDat_ST, "+nA");
|
|
1183
|
+
addTransition(pP3sg_S, pAcc_ST, "+nI");
|
|
1184
|
+
addTransition(pP3sg_S, pLoc_ST, "+ndA", p3sgPronCond);
|
|
1185
|
+
addTransition(pP3sg_S, pAbl_ST, "+ndAn", p3sgPronCond);
|
|
1186
|
+
addTransition(pP3sg_S, pGen_ST, "+nIn", p3sgPronCond);
|
|
1187
|
+
addTransition(pP3sg_S, pEqu_ST, "ncA", p3sgPronCond);
|
|
1188
|
+
addTransition(pP3sg_S, pIns_ST, "+ylA", p3sgPronCond);
|
|
1189
|
+
const hepCond = rootKeyIn([
|
|
1190
|
+
KENDI, KIM, NE, NERE, BIZ, SIZ, BIRI, BIRBIRI, BIRKACI, HERBIRI, HEP, KIMI, COGU, BIRCOGU,
|
|
1191
|
+
TUMU, TOPU, BAZI, HICBIRI, HANGI,
|
|
1192
|
+
]);
|
|
1193
|
+
for (const ps of [pP1pl_S, pP2pl_S]) {
|
|
1194
|
+
addEmpty(ps, pNom_ST);
|
|
1195
|
+
addTransition(ps, pDat_ST, "+nA", nGroup);
|
|
1196
|
+
addTransition(ps, pAcc_ST, "+nI", nGroup);
|
|
1197
|
+
addTransition(ps, pDat_ST, "+yA", yGroup);
|
|
1198
|
+
addTransition(ps, pAcc_ST, "+yI", yGroup);
|
|
1199
|
+
addTransition(ps, pLoc_ST, "+ndA", hepCond);
|
|
1200
|
+
addTransition(ps, pAbl_ST, "+ndAn", hepCond);
|
|
1201
|
+
addTransition(ps, pGen_ST, "+nIn", hepCond);
|
|
1202
|
+
addTransition(ps, pEqu_ST, "+ncA", hepCond);
|
|
1203
|
+
addTransition(ps, pIns_ST, "+nlA", hepCond);
|
|
1204
|
+
}
|
|
1205
|
+
const hepsiCond = rootKeyIn([
|
|
1206
|
+
KENDI, KIM, NE, NERE, O_PERS, BAZI, BIRI, HERKES, UMUM_QUANT, UMUM_PLAIN, BIRKACI, HEPSI,
|
|
1207
|
+
CUMLESI, COGU, BIRCOGU, BIRBIRI, TUMU, KIMI, TOPU, HANGI,
|
|
1208
|
+
]);
|
|
1209
|
+
addEmpty(pP3pl_S, pNom_ST);
|
|
1210
|
+
addTransition(pP3pl_S, pDat_ST, "+nA");
|
|
1211
|
+
addTransition(pP3pl_S, pAcc_ST, "+nI");
|
|
1212
|
+
addTransition(pP3pl_S, pLoc_ST, "+ndA", hepsiCond);
|
|
1213
|
+
addTransition(pP3pl_S, pAbl_ST, "+ndAn", hepsiCond);
|
|
1214
|
+
addTransition(pP3pl_S, pGen_ST, "+nIn", or(hepsiCond, rootKeyIn([SEN, SIZ])));
|
|
1215
|
+
addTransition(pP3pl_S, pEqu_ST, "+ncA", hepsiCond);
|
|
1216
|
+
addTransition(pP3pl_S, pIns_ST, "+ylA", hepsiCond);
|
|
1217
|
+
addTransition(pNom_ST, with_S, "+nlI", rootKeyIn([BU, SU, O_DEMONS, BEN, SEN, O_PERS, BIZ, SIZ]));
|
|
1218
|
+
addTransition(pNom_ST, with_S, "lI", rootKeyIs(NERE));
|
|
1219
|
+
addTransition(pNom_ST, with_S, "+ylI", rootKeyIs(NE));
|
|
1220
|
+
addTransition(pNom_ST, without_S, "+nsIz", rootKeyIn([NERE, BU, SU, O_DEMONS, BEN, SEN, O_PERS, BIZ, SIZ]));
|
|
1221
|
+
addTransition(pNom_ST, without_S, "+ysIz", rootKeyIs(NE));
|
|
1222
|
+
addTransition(pGen_ST, relToPron_S, "ki", rootKeyIn([NERE, BU, SU, O_DEMONS, NE, BEN, SEN, O_PERS, BIZ, SIZ, KIM, KENDI]));
|
|
1223
|
+
addTransition(pLoc_ST, rel_S, "ki", notRelRepetition);
|
|
1224
|
+
addTransition(pIns_ST, vWhile_S, "+yken");
|
|
1225
|
+
for (const ps of [pNom_ST, pDat_ST, pLoc_ST, pAbl_ST, pGen_ST, pIns_ST]) {
|
|
1226
|
+
addEmpty(ps, pronZeroDeriv_S, hasTail);
|
|
1227
|
+
}
|
|
1228
|
+
addEmpty(pronZeroDeriv_S, pvVerbRoot_S);
|
|
1229
|
+
// Verb after pronoun
|
|
1230
|
+
addEmpty(pvVerbRoot_S, pvPresent_S);
|
|
1231
|
+
addTransition(pvVerbRoot_S, vWhile_S, "+yken");
|
|
1232
|
+
addTransition(pvVerbRoot_S, pvPast_S, "+ydI");
|
|
1233
|
+
addTransition(pvVerbRoot_S, pvNarr_S, "+ymIş");
|
|
1234
|
+
addTransition(pvVerbRoot_S, pvCond_S, "+ysA");
|
|
1235
|
+
const pvAllowA1sg = not(prevGroupContains(pA1pl_S, pP1sg_S));
|
|
1236
|
+
const pvAllowA1pl = not(prevGroupContains(pA1sg_S, pA2sg_S, pP1sg_S, pP2sg_S));
|
|
1237
|
+
const pvAllowA2sg = not(prevGroupContains(pA2pl_S, pP2sg_S));
|
|
1238
|
+
const pvAllowA2pl = not(prevGroupContains(pA2sg_S, pP2pl_S));
|
|
1239
|
+
addTransition(pvPresent_S, pvA1sg_ST, "+yIm", pvAllowA1sg);
|
|
1240
|
+
addTransition(pvPresent_S, pvA2sg_ST, "sIn", pvAllowA2sg);
|
|
1241
|
+
addEmpty(pvPresent_S, pvA3sg_S);
|
|
1242
|
+
addTransition(pvPresent_S, pvA1pl_ST, "+yIz", pvAllowA1pl);
|
|
1243
|
+
addTransition(pvPresent_S, pvA2pl_ST, "sInIz");
|
|
1244
|
+
addTransition(pvPresent_S, pvA3pl_ST, "lAr", prevGroupContains(pLoc_ST));
|
|
1245
|
+
addTransition(pvPast_S, pvA1sg_ST, "m", pvAllowA1sg);
|
|
1246
|
+
addTransition(pvPast_S, pvA2sg_ST, "n", pvAllowA2sg);
|
|
1247
|
+
addTransition(pvPast_S, pvA1pl_ST, "k", pvAllowA1pl);
|
|
1248
|
+
addTransition(pvPast_S, pvA2pl_ST, "InIz");
|
|
1249
|
+
addTransition(pvPast_S, pvA3pl_ST, "lAr");
|
|
1250
|
+
addEmpty(pvPast_S, pvA3sg_ST);
|
|
1251
|
+
addTransition(pvNarr_S, pvA1sg_ST, "Im", pvAllowA1sg);
|
|
1252
|
+
addTransition(pvNarr_S, pvA2sg_ST, "sIn", pvAllowA2sg);
|
|
1253
|
+
addTransition(pvNarr_S, pvA1pl_ST, "Iz", pvAllowA1pl);
|
|
1254
|
+
addTransition(pvNarr_S, pvA2pl_ST, "sInIz");
|
|
1255
|
+
addTransition(pvNarr_S, pvA3pl_ST, "lAr");
|
|
1256
|
+
addEmpty(pvNarr_S, pvA3sg_ST);
|
|
1257
|
+
addTransition(pvNarr_S, pvCond_S, "sA");
|
|
1258
|
+
addTransition(pvCond_S, pvA1sg_ST, "m", pvAllowA1sg);
|
|
1259
|
+
addTransition(pvCond_S, pvA2sg_ST, "n", pvAllowA2sg);
|
|
1260
|
+
addTransition(pvCond_S, pvA1pl_ST, "k", pvAllowA1pl);
|
|
1261
|
+
addTransition(pvCond_S, pvA2pl_ST, "nIz", pvAllowA2pl);
|
|
1262
|
+
addEmpty(pvCond_S, pvA3sg_ST);
|
|
1263
|
+
addTransition(pvCond_S, pvA3pl_ST, "lAr");
|
|
1264
|
+
const pvRejectNoCopula = not(currentGroupContains(pvPast_S, pvCond_S, pvCopBeforeA3pl_S));
|
|
1265
|
+
addTransition(pvA1sg_ST, pvCop_ST, "dIr", pvRejectNoCopula);
|
|
1266
|
+
addTransition(pvA2sg_ST, pvCop_ST, "dIr", pvRejectNoCopula);
|
|
1267
|
+
addTransition(pvA1pl_ST, pvCop_ST, "dIr", pvRejectNoCopula);
|
|
1268
|
+
addTransition(pvA2pl_ST, pvCop_ST, "dIr", pvRejectNoCopula);
|
|
1269
|
+
addTransition(pvA3sg_S, pvCop_ST, ">dIr", pvRejectNoCopula);
|
|
1270
|
+
addTransition(pvA3pl_ST, pvCop_ST, "dIr", pvRejectNoCopula);
|
|
1271
|
+
const pvA3plAfterLoc = prevStateIs(pvPresent_S);
|
|
1272
|
+
addTransition(pvA3pl_ST, vPastAfterTense_ST, "dI", pvA3plAfterLoc);
|
|
1273
|
+
addTransition(pvA3pl_ST, vNarrAfterTense_ST, "mIş", pvA3plAfterLoc);
|
|
1274
|
+
addTransition(pvA3pl_ST, vCond_ST, "sA", pvA3plAfterLoc);
|
|
1275
|
+
addTransition(pvA3pl_ST, vWhile_S, "ken", pvA3plAfterLoc);
|
|
1276
|
+
addTransition(pvPresent_S, pvCopBeforeA3pl_S, ">dIr");
|
|
1277
|
+
addTransition(pvCopBeforeA3pl_S, pvA3pl_ST, "lAr");
|
|
1278
|
+
// =========================================================================
|
|
1279
|
+
// 6. Adverbs & Postpositives
|
|
1280
|
+
// =========================================================================
|
|
1281
|
+
addEmpty(advNounRoot_ST, avZero_S);
|
|
1282
|
+
addEmpty(avZero_S, avNounAfterAdvRoot_S);
|
|
1283
|
+
addEmpty(avNounAfterAdvRoot_S, avA3sg_S);
|
|
1284
|
+
addEmpty(avA3sg_S, avPnon_S);
|
|
1285
|
+
addTransition(avPnon_S, avDat_ST, "+yA");
|
|
1286
|
+
addEmpty(advForVerbDeriv_ST, avZeroToVerb_S);
|
|
1287
|
+
addEmpty(avZeroToVerb_S, nVerb_S);
|
|
1288
|
+
addEmpty(postpRoot_ST, postpZero_S, hasTail);
|
|
1289
|
+
addEmpty(postpZero_S, nVerb_S);
|
|
1290
|
+
const isGibi = rootKeyIn(["gibi_Postp_PCGen", "gibi_Postp_PCNom"]);
|
|
1291
|
+
const isGibiOrSonra = rootKeyIn(["gibi_Postp_PCGen", "gibi_Postp_PCNom", "sonra_Postp_PCAbl"]);
|
|
1292
|
+
addEmpty(postpZero_S, po2nRoot_S, isGibiOrSonra);
|
|
1293
|
+
addEmpty(po2nRoot_S, po2nA3sg_S);
|
|
1294
|
+
addTransition(po2nRoot_S, po2nA3pl_S, "lAr");
|
|
1295
|
+
addTransition(po2nA3sg_S, po2nP3sg_S, "+sI");
|
|
1296
|
+
addTransition(po2nA3sg_S, po2nP1sg_S, "m", isGibi);
|
|
1297
|
+
addTransition(po2nA3sg_S, po2nP2sg_S, "n", isGibi);
|
|
1298
|
+
addTransition(po2nA3sg_S, po2nP1pl_S, "miz", isGibi);
|
|
1299
|
+
addTransition(po2nA3sg_S, po2nP2pl_S, "niz", isGibi);
|
|
1300
|
+
addTransition(po2nA3pl_S, po2nP3sg_S, "+sI");
|
|
1301
|
+
addEmpty(po2nA3pl_S, po2nPnon_S);
|
|
1302
|
+
addEmpty(po2nP3sg_S, po2nNom_ST);
|
|
1303
|
+
addTransition(po2nP3sg_S, po2nDat_ST, "nA");
|
|
1304
|
+
addTransition(po2nP3sg_S, po2nLoc_ST, "ndA");
|
|
1305
|
+
addTransition(po2nP3sg_S, po2nAbl_ST, "ndAn");
|
|
1306
|
+
addTransition(po2nP3sg_S, po2nIns_ST, "ylA");
|
|
1307
|
+
addTransition(po2nP3sg_S, po2nGen_ST, "nIn");
|
|
1308
|
+
addTransition(po2nP3sg_S, po2nAcc_ST, "nI");
|
|
1309
|
+
addEmpty(po2nPnon_S, po2nNom_ST);
|
|
1310
|
+
addTransition(po2nPnon_S, po2nDat_ST, "A");
|
|
1311
|
+
addTransition(po2nPnon_S, po2nLoc_ST, "dA");
|
|
1312
|
+
addTransition(po2nPnon_S, po2nAbl_ST, "dAn");
|
|
1313
|
+
addTransition(po2nPnon_S, po2nIns_ST, "lA");
|
|
1314
|
+
addTransition(po2nPnon_S, po2nGen_ST, "In");
|
|
1315
|
+
addTransition(po2nPnon_S, po2nEqu_ST, "cA");
|
|
1316
|
+
addTransition(po2nPnon_S, po2nAcc_ST, "I");
|
|
1317
|
+
addTransition(po2nP1sg_S, po2nDat_ST, "e");
|
|
1318
|
+
addTransition(po2nP2sg_S, po2nDat_ST, "e");
|
|
1319
|
+
addTransition(po2nP1pl_S, po2nDat_ST, "e");
|
|
1320
|
+
addTransition(po2nP2pl_S, po2nDat_ST, "e");
|
|
1321
|
+
// =========================================================================
|
|
1322
|
+
// 7. Verbs
|
|
1323
|
+
// =========================================================================
|
|
1324
|
+
// Imperative
|
|
1325
|
+
addEmpty(verbRoot_S, vImp_S);
|
|
1326
|
+
addEmpty(vImp_S, vA2sg_ST);
|
|
1327
|
+
addTransition(vImp_S, vA2sg_ST, "sAnA");
|
|
1328
|
+
addTransition(vImp_S, vA3sg_ST, "sIn");
|
|
1329
|
+
addTransition(vImp_S, vA2pl_ST, "+yIn");
|
|
1330
|
+
addTransition(vImp_S, vA2pl_ST, "+yInIz");
|
|
1331
|
+
addTransition(vImp_S, vA2pl_ST, "sAnIzA");
|
|
1332
|
+
addTransition(vImp_S, vA3pl_ST, "sInlAr");
|
|
1333
|
+
// Causative (-t, ->dIr) with chaining (e.g. araştır-t, oku-t-tur, yap-tır-t)
|
|
1334
|
+
const noCausAfterCompound = not(lastDerivIn([vEverSince_S, vRepeat_S, vAlmost_S, vHastily_S, vStay_S, vStart_S]));
|
|
1335
|
+
addTransition(verbRoot_S, vCausT_S, "t", and(or(hasAttr(RA_CAUSATIVE_T), lastDerivIs(vCausTır_S)), not(lastDerivIn([vCausT_S, vPass_S, vAble_S, become_S, acquire_S])), noCausAfterCompound));
|
|
1336
|
+
addTransition(verbRoot_S, vCausTır_S, ">dIr", and(hasPhon(PA_LAST_CONSONANT), not(lastDerivIn([vCausTır_S, vPass_S, vAble_S])), noCausAfterCompound));
|
|
1337
|
+
addEmpty(vCausT_S, verbRoot_S);
|
|
1338
|
+
addEmpty(vCausTır_S, verbRoot_S);
|
|
1339
|
+
// Progressive 1 (-Iyor)
|
|
1340
|
+
addTransition(verbRoot_S, vProgYor_S, "Iyor", notHavePhon(PA_LAST_VOWEL));
|
|
1341
|
+
addTransition(verbRoot_VowelDrop_S, vProgYor_S, "Iyor");
|
|
1342
|
+
addTransition(vProgYor_S, vA1sg_ST, "um");
|
|
1343
|
+
addTransition(vProgYor_S, vA2sg_ST, "sun");
|
|
1344
|
+
addEmpty(vProgYor_S, vA3sg_ST);
|
|
1345
|
+
addTransition(vProgYor_S, vA1pl_ST, "uz");
|
|
1346
|
+
addTransition(vProgYor_S, vA2pl_ST, "sunuz");
|
|
1347
|
+
addTransition(vProgYor_S, vA3pl_ST, "lar");
|
|
1348
|
+
addTransition(vProgYor_S, vCond_S, "sa");
|
|
1349
|
+
addTransition(vProgYor_S, vPastAfterTense_S, "du");
|
|
1350
|
+
addTransition(vProgYor_S, vNarrAfterTense_S, "muş");
|
|
1351
|
+
addTransition(vProgYor_S, vCopBeforeA3pl_S, "dur");
|
|
1352
|
+
addTransition(vProgYor_S, vWhile_S, "ken");
|
|
1353
|
+
// Progressive 2 (-mAktA)
|
|
1354
|
+
addTransition(verbRoot_S, vProgMakta_S, "mAktA");
|
|
1355
|
+
addTransition(vProgMakta_S, vA1sg_ST, "yIm");
|
|
1356
|
+
addTransition(vProgMakta_S, vA2sg_ST, "sIn");
|
|
1357
|
+
addEmpty(vProgMakta_S, vA3sg_ST);
|
|
1358
|
+
addTransition(vProgMakta_S, vA1pl_ST, "yIz");
|
|
1359
|
+
addTransition(vProgMakta_S, vA2pl_ST, "sInIz");
|
|
1360
|
+
addTransition(vProgMakta_S, vA3pl_ST, "lAr");
|
|
1361
|
+
addTransition(vProgMakta_S, vCond_S, "ysA");
|
|
1362
|
+
addTransition(vProgMakta_S, vPastAfterTense_S, "ydI");
|
|
1363
|
+
addTransition(vProgMakta_S, vNarrAfterTense_S, "ymIş");
|
|
1364
|
+
addTransition(vProgMakta_S, vCopBeforeA3pl_S, "dIr");
|
|
1365
|
+
addTransition(vProgMakta_S, vWhile_S, "yken");
|
|
1366
|
+
// Positive Aorist (-Ir / -Ar)
|
|
1367
|
+
const aorICond = or(hasAttr(RA_AORIST_I), hasSurface);
|
|
1368
|
+
const aorACond = and(hasAttr(RA_AORIST_A), hasNoSurface);
|
|
1369
|
+
addTransition(verbRoot_S, vAor_S, "Ir", aorICond);
|
|
1370
|
+
addTransition(verbRoot_S, vAor_S, "Ar", aorACond);
|
|
1371
|
+
addTransition(vAor_S, vA1sg_ST, "Im");
|
|
1372
|
+
addTransition(vAor_S, vA2sg_ST, "sIn");
|
|
1373
|
+
addEmpty(vAor_S, vA3sg_ST);
|
|
1374
|
+
addTransition(vAor_S, vA1pl_ST, "Iz");
|
|
1375
|
+
addTransition(vAor_S, vA2pl_ST, "sInIz");
|
|
1376
|
+
addTransition(vAor_S, vA3pl_ST, "lAr");
|
|
1377
|
+
addTransition(vAor_S, vPastAfterTense_S, "dI");
|
|
1378
|
+
addTransition(vAor_S, vNarrAfterTense_S, "mIş");
|
|
1379
|
+
addTransition(vAor_S, vCond_S, "sA");
|
|
1380
|
+
addTransition(vAor_S, vCopBeforeA3pl_S, "dIr");
|
|
1381
|
+
addTransition(vAor_S, vWhile_S, "ken");
|
|
1382
|
+
// Negative (-mA)
|
|
1383
|
+
addTransition(verbRoot_S, vNeg_S, "mA", prevMorphemeIsNot(M.able));
|
|
1384
|
+
addEmpty(vNeg_S, vImp_S);
|
|
1385
|
+
addTransition(vNeg_S, vPast_S, "dI");
|
|
1386
|
+
addTransition(vNeg_S, vFut_S, "yAcA~k");
|
|
1387
|
+
addTransition(vNeg_S, vFut_S, "yAcA!ğ");
|
|
1388
|
+
addTransition(vNeg_S, vNarr_S, "mIş");
|
|
1389
|
+
addTransition(vNeg_S, vProgMakta_S, "mAktA");
|
|
1390
|
+
addTransition(vNeg_S, vOpt_S, "yA");
|
|
1391
|
+
addTransition(vNeg_S, vDesr_S, "sA");
|
|
1392
|
+
addTransition(vNeg_S, vNeces_S, "mAlI");
|
|
1393
|
+
addTransition(vNeg_S, vInf1_S, "mAk");
|
|
1394
|
+
addTransition(vNeg_S, vInf2_S, "mA");
|
|
1395
|
+
addTransition(vNeg_S, vInf3_S, "yIş");
|
|
1396
|
+
addTransition(vNeg_S, vActOf_S, "mAcA");
|
|
1397
|
+
addTransition(vNeg_S, vPastPart_S, "dI~k");
|
|
1398
|
+
addTransition(vNeg_S, vPastPart_S, "dI!ğ");
|
|
1399
|
+
addTransition(vNeg_S, vFutPart_S, "yAcA~k");
|
|
1400
|
+
addTransition(vNeg_S, vFutPart_S, "yAcA!ğ");
|
|
1401
|
+
addTransition(vNeg_S, vPresPart_S, "yAn");
|
|
1402
|
+
addTransition(vNeg_S, vNarrPart_S, "mIş");
|
|
1403
|
+
addTransition(vNeg_S, vSinceDoingSo_S, "yAlI");
|
|
1404
|
+
addTransition(vNeg_S, vByDoingSo_S, "yArAk");
|
|
1405
|
+
addTransition(vNeg_S, vHastily_S, "yIver");
|
|
1406
|
+
addTransition(vNeg_S, vEverSince_S, "yAgör");
|
|
1407
|
+
addTransition(vNeg_S, vAfterDoing_S, "yIp");
|
|
1408
|
+
addTransition(vNeg_S, vWhen_S, "yIncA");
|
|
1409
|
+
addTransition(vNeg_S, vAsLongAs_S, "dIkçA");
|
|
1410
|
+
addTransition(vNeg_S, vNotState_S, "mAzlI~k");
|
|
1411
|
+
addTransition(vNeg_S, vNotState_S, "mAzlI!ğ");
|
|
1412
|
+
addTransition(vNeg_S, vFeelLike_S, "yAsI");
|
|
1413
|
+
addTransition(vNeg_S, vAorNeg_S, "z");
|
|
1414
|
+
addEmpty(vNeg_S, vAorNegEmpty_S);
|
|
1415
|
+
addTransition(vNeg_S, vAorPartNeg_S, "z");
|
|
1416
|
+
addTransition(vNeg_S, vAble_S, "yAbil");
|
|
1417
|
+
// Negative before -Iyor (-m + Iyor)
|
|
1418
|
+
addTransition(verbRoot_S, vNegProg1_S, "m");
|
|
1419
|
+
addTransition(vNegProg1_S, vProgYor_S, "Iyor");
|
|
1420
|
+
// Negative Aorist
|
|
1421
|
+
addTransition(vAorNeg_S, vA2sg_ST, "sIn");
|
|
1422
|
+
addEmpty(vAorNeg_S, vA3sg_ST);
|
|
1423
|
+
addTransition(vAorNeg_S, vA2pl_ST, "sInIz");
|
|
1424
|
+
addTransition(vAorNeg_S, vA3pl_ST, "lAr");
|
|
1425
|
+
addTransition(vAorNeg_S, vPastAfterTense_S, "dI");
|
|
1426
|
+
addTransition(vAorNeg_S, vNarrAfterTense_S, "mIş");
|
|
1427
|
+
addTransition(vAorNeg_S, vCond_S, "sA");
|
|
1428
|
+
addTransition(vAorNeg_S, vCopBeforeA3pl_S, "dIr");
|
|
1429
|
+
addTransition(vAorNeg_S, vWhile_S, "ken");
|
|
1430
|
+
addTransition(vAorNegEmpty_S, vA1sg_ST, "m");
|
|
1431
|
+
addTransition(vAorNegEmpty_S, vA1pl_ST, "yIz");
|
|
1432
|
+
addEmpty(vAorPartNeg_S, adjAfterVerb_ST);
|
|
1433
|
+
// Ability (+yAbil) & Unable (+yAmA, +yAm)
|
|
1434
|
+
addTransition(verbRoot_S, vAble_S, "+yAbil", not(lastDerivIs(vAble_S)));
|
|
1435
|
+
addEmpty(vAble_S, verbRoot_S);
|
|
1436
|
+
addEmpty(vAbleNeg_S, vAbleNegDerivRoot_S);
|
|
1437
|
+
addTransition(vAbleNegDerivRoot_S, vNeg_S, "mA");
|
|
1438
|
+
addTransition(vAbleNegDerivRoot_S, vNegProg1_S, "m");
|
|
1439
|
+
addTransition(verbRoot_S, vUnable_S, "+yAmA", prevMorphemeIsNot(M.able));
|
|
1440
|
+
copyOutgoing(vUnable_S, vNeg_S);
|
|
1441
|
+
addTransition(verbRoot_S, vUnableProg1_S, "+yAm");
|
|
1442
|
+
addTransition(vUnableProg1_S, vProgYor_S, "Iyor");
|
|
1443
|
+
// Verbal nouns, participles, and adjectives
|
|
1444
|
+
addTransition(verbRoot_S, vInf1_S, "mA~k");
|
|
1445
|
+
addEmpty(vInf1_S, nounInf1Root_S);
|
|
1446
|
+
addTransition(verbRoot_S, vInf2_S, "mA");
|
|
1447
|
+
addEmpty(vInf2_S, noun_S);
|
|
1448
|
+
addTransition(verbRoot_S, vInf3_S, "+yIş");
|
|
1449
|
+
addEmpty(vInf3_S, noun_S);
|
|
1450
|
+
addTransition(verbRoot_S, vAgt_S, "+yIcI");
|
|
1451
|
+
addEmpty(vAgt_S, noun_S);
|
|
1452
|
+
addEmpty(vAgt_S, adjAfterVerb_ST);
|
|
1453
|
+
addTransition(verbRoot_S, vActOf_S, "mAcA");
|
|
1454
|
+
addEmpty(vActOf_S, nounActOfRoot_S);
|
|
1455
|
+
addTransition(verbRoot_S, vPastPart_S, ">dI~k");
|
|
1456
|
+
addTransition(verbRoot_S, vPastPart_S, ">dI!ğ");
|
|
1457
|
+
addEmpty(vPastPart_S, noun_S);
|
|
1458
|
+
addEmpty(vPastPart_S, adjAfterVerb_S);
|
|
1459
|
+
addTransition(verbRoot_S, vFutPart_S, "+yAcA~k");
|
|
1460
|
+
addTransition(verbRoot_S, vFutPart_S, "+yAcA!ğ");
|
|
1461
|
+
addEmpty(vFutPart_S, noun_S, hasTail);
|
|
1462
|
+
addEmpty(vFutPart_S, adjAfterVerb_S);
|
|
1463
|
+
addTransition(verbRoot_S, vNarrPart_S, "mIş");
|
|
1464
|
+
addEmpty(vNarrPart_S, adjectiveRoot_ST);
|
|
1465
|
+
addTransition(verbRoot_S, vAorPart_S, "Ir", aorICond);
|
|
1466
|
+
addTransition(verbRoot_S, vAorPart_S, "Ar", aorACond);
|
|
1467
|
+
addEmpty(vAorPart_S, adjAfterVerb_ST);
|
|
1468
|
+
addTransition(verbRoot_S, vPresPart_S, "+yAn");
|
|
1469
|
+
addEmpty(vPresPart_S, noun_S, hasTail);
|
|
1470
|
+
addEmpty(vPresPart_S, adjAfterVerb_ST);
|
|
1471
|
+
addTransition(verbRoot_S, vFeelLike_S, "+yAsI");
|
|
1472
|
+
addEmpty(vFeelLike_S, noun_S, hasTail);
|
|
1473
|
+
addEmpty(vFeelLike_S, adjAfterVerb_ST);
|
|
1474
|
+
addTransition(verbRoot_S, vNotState_S, "mAzlI~k");
|
|
1475
|
+
addTransition(verbRoot_S, vNotState_S, "mAzlI!ğ");
|
|
1476
|
+
addEmpty(vNotState_S, noun_S);
|
|
1477
|
+
// Implicit Reciprocal & Reflexive
|
|
1478
|
+
addEmpty(vImplicitRecipRoot_S, vRecip_S);
|
|
1479
|
+
addEmpty(vRecip_S, verbRoot_S);
|
|
1480
|
+
addEmpty(vImplicitReflexRoot_S, vReflex_S);
|
|
1481
|
+
addEmpty(vReflex_S, verbRoot_S);
|
|
1482
|
+
// Passive (-In, -InIl, +nIl)
|
|
1483
|
+
const notPassOrAble = and(not(containsMorpheme(M.pass)), not(containsMorpheme(M.able)));
|
|
1484
|
+
const prevIsCaus = prevStateIn([vCausT_S, vCausTır_S]);
|
|
1485
|
+
const notAfterDerivStem = not(prevStateIn([vCausT_S, vCausTır_S, vEverSince_S, vRepeat_S, vAlmost_S, vHastily_S, vStay_S, vStart_S]));
|
|
1486
|
+
addTransition(verbRoot_S, vPass_S, "In", and(hasAttr(RA_PASSIVE_IN), notPassOrAble, notAfterDerivStem));
|
|
1487
|
+
addTransition(verbRoot_S, vPass_S, "InIl", and(hasAttr(RA_PASSIVE_IN), notPassOrAble, notAfterDerivStem));
|
|
1488
|
+
addTransition(verbRoot_S, vPass_S, "+nIl", and(not(containsMorpheme(M.able)), or(prevIsCaus, and(notHaveAttr(RA_PASSIVE_IN), not(containsMorpheme(M.pass))))));
|
|
1489
|
+
addEmpty(vPass_S, verbRoot_S);
|
|
1490
|
+
// Condition (-sA)
|
|
1491
|
+
addTransition(vCond_S, vA1sg_ST, "m");
|
|
1492
|
+
addTransition(vCond_S, vA2sg_ST, "n");
|
|
1493
|
+
addEmpty(vCond_S, vA3sg_ST);
|
|
1494
|
+
addTransition(vCond_S, vA1pl_ST, "k");
|
|
1495
|
+
addTransition(vCond_S, vA2pl_ST, "nIz");
|
|
1496
|
+
addTransition(vCond_S, vA3pl_ST, "lAr");
|
|
1497
|
+
// Past (>dI)
|
|
1498
|
+
addTransition(verbRoot_S, vPast_S, ">dI");
|
|
1499
|
+
addTransition(vPast_S, vA1sg_ST, "m");
|
|
1500
|
+
addTransition(vPast_S, vA2sg_ST, "n");
|
|
1501
|
+
addEmpty(vPast_S, vA3sg_ST);
|
|
1502
|
+
addTransition(vPast_S, vA1pl_ST, "k");
|
|
1503
|
+
addTransition(vPast_S, vA2pl_ST, "nIz");
|
|
1504
|
+
addTransition(vPast_S, vA3pl_ST, "lAr");
|
|
1505
|
+
addTransition(vPast_S, vCond_S, "ysA");
|
|
1506
|
+
// Narrative (-mIş)
|
|
1507
|
+
addTransition(verbRoot_S, vNarr_S, "mIş");
|
|
1508
|
+
addTransition(vNarr_S, vA1sg_ST, "Im");
|
|
1509
|
+
addTransition(vNarr_S, vA2sg_ST, "sIn");
|
|
1510
|
+
addEmpty(vNarr_S, vA3sg_ST);
|
|
1511
|
+
addTransition(vNarr_S, vA1pl_ST, "Iz");
|
|
1512
|
+
addTransition(vNarr_S, vA2pl_ST, "sInIz");
|
|
1513
|
+
addTransition(vNarr_S, vA3pl_ST, "lAr");
|
|
1514
|
+
addTransition(vNarr_S, vCond_S, "sA");
|
|
1515
|
+
addTransition(vNarr_S, vPastAfterTense_S, "tI");
|
|
1516
|
+
addTransition(vNarr_S, vCopBeforeA3pl_S, "tIr");
|
|
1517
|
+
addTransition(vNarr_S, vWhile_S, "ken");
|
|
1518
|
+
addTransition(vNarr_S, vNarrAfterTense_S, "mIş");
|
|
1519
|
+
// Past after tense
|
|
1520
|
+
addTransition(vPastAfterTense_S, vA1sg_ST, "m");
|
|
1521
|
+
addTransition(vPastAfterTense_S, vA2sg_ST, "n");
|
|
1522
|
+
addEmpty(vPastAfterTense_S, vA3sg_ST);
|
|
1523
|
+
addTransition(vPastAfterTense_S, vA1pl_ST, "k");
|
|
1524
|
+
addTransition(vPastAfterTense_S, vA2pl_ST, "nIz");
|
|
1525
|
+
addTransition(vPastAfterTense_S, vA3pl_ST, "lAr");
|
|
1526
|
+
// Narrative after tense
|
|
1527
|
+
addTransition(vNarrAfterTense_S, vA1sg_ST, "Im");
|
|
1528
|
+
addTransition(vNarrAfterTense_S, vA2sg_ST, "sIn");
|
|
1529
|
+
addEmpty(vNarrAfterTense_S, vA3sg_ST);
|
|
1530
|
+
addTransition(vNarrAfterTense_S, vA1pl_ST, "Iz");
|
|
1531
|
+
addTransition(vNarrAfterTense_S, vA2pl_ST, "sInIz");
|
|
1532
|
+
addTransition(vNarrAfterTense_S, vA3pl_ST, "lAr");
|
|
1533
|
+
addTransition(vNarrAfterTense_S, vWhile_S, "ken");
|
|
1534
|
+
addTransition(vNarrAfterTense_S, vCopBeforeA3pl_S, "tIr");
|
|
1535
|
+
// Future (+yAcA~k, +yAcA!ğ)
|
|
1536
|
+
addTransition(verbRoot_S, vFut_S, "+yAcA~k");
|
|
1537
|
+
addTransition(verbRoot_S, vFut_S, "+yAcA!ğ");
|
|
1538
|
+
addTransition(vFut_S, vA1sg_ST, "Im");
|
|
1539
|
+
addTransition(vFut_S, vA2sg_ST, "sIn");
|
|
1540
|
+
addEmpty(vFut_S, vA3sg_ST);
|
|
1541
|
+
addTransition(vFut_S, vA1pl_ST, "Iz");
|
|
1542
|
+
addTransition(vFut_S, vA2pl_ST, "sInIz");
|
|
1543
|
+
addTransition(vFut_S, vA3pl_ST, "lAr");
|
|
1544
|
+
addTransition(vFut_S, vCond_S, "sA");
|
|
1545
|
+
addTransition(vFut_S, vPastAfterTense_S, "tI");
|
|
1546
|
+
addTransition(vFut_S, vNarrAfterTense_S, "mIş");
|
|
1547
|
+
addTransition(vFut_S, vCopBeforeA3pl_S, "tIr");
|
|
1548
|
+
addTransition(vFut_S, vWhile_S, "ken");
|
|
1549
|
+
// Special irregular verbs: demek / yemek (de/di, ye/yi)
|
|
1550
|
+
const diYiCond = rootSurfaceIn(["di", "yi"]);
|
|
1551
|
+
const deYeCond = rootSurfaceIn(["de", "ye"]);
|
|
1552
|
+
const cMultiVerb = not(prevMorphemeIn([M.everSince, M.repeat, M.almost, M.hastily, M.stay, M.start]));
|
|
1553
|
+
addTransition(vDeYeRoot_S, vFut_S, "yece~k", diYiCond);
|
|
1554
|
+
addTransition(vDeYeRoot_S, vFut_S, "yece!ğ", diYiCond);
|
|
1555
|
+
addTransition(vDeYeRoot_S, vProgYor_S, "yor", diYiCond);
|
|
1556
|
+
addTransition(vDeYeRoot_S, vAble_S, "yebil", diYiCond);
|
|
1557
|
+
addTransition(vDeYeRoot_S, vAbleNeg_S, "ye", diYiCond);
|
|
1558
|
+
addTransition(vDeYeRoot_S, vInf3_S, "yiş", rootSurfaceIs("yi"));
|
|
1559
|
+
addTransition(vDeYeRoot_S, vFutPart_S, "yece~k", diYiCond);
|
|
1560
|
+
addTransition(vDeYeRoot_S, vFutPart_S, "yece!ğ", diYiCond);
|
|
1561
|
+
addTransition(vDeYeRoot_S, vPresPart_S, "yen", diYiCond);
|
|
1562
|
+
addTransition(vDeYeRoot_S, vEverSince_S, "yegel", and(diYiCond, cMultiVerb));
|
|
1563
|
+
addTransition(vDeYeRoot_S, vRepeat_S, "yedur", and(diYiCond, cMultiVerb));
|
|
1564
|
+
addTransition(vDeYeRoot_S, vRepeat_S, "yegör", and(diYiCond, cMultiVerb));
|
|
1565
|
+
addTransition(vDeYeRoot_S, vAlmost_S, "yeyaz", and(diYiCond, cMultiVerb));
|
|
1566
|
+
addTransition(vDeYeRoot_S, vStart_S, "yekoy", and(diYiCond, cMultiVerb));
|
|
1567
|
+
addTransition(vDeYeRoot_S, vHastily_S, "yiver", and(diYiCond, cMultiVerb));
|
|
1568
|
+
addTransition(vDeYeRoot_S, vSinceDoingSo_S, "yeli", diYiCond);
|
|
1569
|
+
addTransition(vDeYeRoot_S, vByDoingSo_S, "yerek", diYiCond);
|
|
1570
|
+
addTransition(vDeYeRoot_S, vFeelLike_S, "yesi", diYiCond);
|
|
1571
|
+
addTransition(vDeYeRoot_S, vAfterDoing_S, "yip", rootSurfaceIn(["de", "yi"]));
|
|
1572
|
+
addTransition(vDeYeRoot_S, vWhen_S, "yince", rootSurfaceIn(["de", "yi"]));
|
|
1573
|
+
addTransition(vDeYeRoot_S, vWithoutBeingAbleToHaveDoneSo_S, "yemeden", diYiCond);
|
|
1574
|
+
addTransition(vDeYeRoot_S, vOpt_S, "ye", diYiCond);
|
|
1575
|
+
addTransition(vDeYeRoot_S, vCausTır_S, "dir", deYeCond);
|
|
1576
|
+
addTransition(vDeYeRoot_S, vPass_S, "n", deYeCond);
|
|
1577
|
+
addTransition(vDeYeRoot_S, vPass_S, "nil", deYeCond);
|
|
1578
|
+
addTransition(vDeYeRoot_S, vPast_S, "di", deYeCond);
|
|
1579
|
+
addTransition(vDeYeRoot_S, vNarr_S, "miş", deYeCond);
|
|
1580
|
+
addTransition(vDeYeRoot_S, vAor_S, "r", deYeCond);
|
|
1581
|
+
addTransition(vDeYeRoot_S, vNeg_S, "me", deYeCond);
|
|
1582
|
+
addTransition(vDeYeRoot_S, vNegProg1_S, "m", deYeCond);
|
|
1583
|
+
addTransition(vDeYeRoot_S, vProgMakta_S, "mekte", deYeCond);
|
|
1584
|
+
addTransition(vDeYeRoot_S, vDesr_S, "se", deYeCond);
|
|
1585
|
+
addTransition(vDeYeRoot_S, vInf1_S, "mek", deYeCond);
|
|
1586
|
+
addTransition(vDeYeRoot_S, vInf2_S, "me", deYeCond);
|
|
1587
|
+
addTransition(vDeYeRoot_S, vInf3_S, "yiş", rootSurfaceIs("de"));
|
|
1588
|
+
addTransition(vDeYeRoot_S, vPastPart_S, "di~k", deYeCond);
|
|
1589
|
+
addTransition(vDeYeRoot_S, vPastPart_S, "di!ğ", deYeCond);
|
|
1590
|
+
addTransition(vDeYeRoot_S, vNarrPart_S, "miş", deYeCond);
|
|
1591
|
+
addTransition(vDeYeRoot_S, vAsLongAs_S, "dikçe", deYeCond);
|
|
1592
|
+
addTransition(vDeYeRoot_S, vWithoutHavingDoneSo_S, "meden", deYeCond);
|
|
1593
|
+
addTransition(vDeYeRoot_S, vWithoutHavingDoneSo_S, "meksizin", deYeCond);
|
|
1594
|
+
addTransition(vDeYeRoot_S, vNeces_S, "meli", deYeCond);
|
|
1595
|
+
addTransition(vDeYeRoot_S, vNotState_S, "mezli~k", deYeCond);
|
|
1596
|
+
addTransition(vDeYeRoot_S, vNotState_S, "mezli!ğ", deYeCond);
|
|
1597
|
+
addEmpty(vDeYeRoot_S, vImp_S, rootSurfaceIs("de"));
|
|
1598
|
+
addEmpty(vDeYeRoot_S, vImpYemekYe_S, rootSurfaceIs("ye"));
|
|
1599
|
+
addEmpty(vDeYeRoot_S, vImpYemekYi_S, rootSurfaceIs("yi"));
|
|
1600
|
+
addTransition(vImpYemekYi_S, vA2pl_ST, "yin");
|
|
1601
|
+
addTransition(vImpYemekYi_S, vA2pl_ST, "yiniz");
|
|
1602
|
+
addEmpty(vImpYemekYe_S, vA2sg_ST);
|
|
1603
|
+
addTransition(vImpYemekYe_S, vA2sg_ST, "sene");
|
|
1604
|
+
addTransition(vImpYemekYe_S, vA3sg_ST, "sin");
|
|
1605
|
+
addTransition(vImpYemekYe_S, vA2pl_ST, "senize");
|
|
1606
|
+
addTransition(vImpYemekYe_S, vA3pl_ST, "sinler");
|
|
1607
|
+
// Optative (+yA)
|
|
1608
|
+
addTransition(verbRoot_S, vOpt_S, "+yA");
|
|
1609
|
+
addTransition(vOpt_S, vA1sg_ST, "yIm");
|
|
1610
|
+
addTransition(vOpt_S, vA2sg_ST, "sIn");
|
|
1611
|
+
addEmpty(vOpt_S, vA3sg_ST);
|
|
1612
|
+
addTransition(vOpt_S, vA1pl_ST, "lIm");
|
|
1613
|
+
addTransition(vOpt_S, vA2pl_ST, "sInIz");
|
|
1614
|
+
addTransition(vOpt_S, vA3pl_ST, "lAr");
|
|
1615
|
+
addTransition(vOpt_S, vPastAfterTense_S, "ydI");
|
|
1616
|
+
addTransition(vOpt_S, vNarrAfterTense_S, "ymIş");
|
|
1617
|
+
// Desire (-sA)
|
|
1618
|
+
addTransition(verbRoot_S, vDesr_S, "sA");
|
|
1619
|
+
addTransition(vDesr_S, vA1sg_ST, "m");
|
|
1620
|
+
addTransition(vDesr_S, vA2sg_ST, "n");
|
|
1621
|
+
addEmpty(vDesr_S, vA3sg_ST);
|
|
1622
|
+
addTransition(vDesr_S, vA1pl_ST, "k");
|
|
1623
|
+
addTransition(vDesr_S, vA2pl_ST, "nIz");
|
|
1624
|
+
addTransition(vDesr_S, vA3pl_ST, "lAr");
|
|
1625
|
+
addTransition(vDesr_S, vPastAfterTense_S, "ydI");
|
|
1626
|
+
addTransition(vDesr_S, vNarrAfterTense_S, "ymIş");
|
|
1627
|
+
// Necessity (-mAlI)
|
|
1628
|
+
addTransition(verbRoot_S, vNeces_S, "mAlI");
|
|
1629
|
+
addTransition(vNeces_S, vA1sg_ST, "yIm");
|
|
1630
|
+
addTransition(vNeces_S, vA2sg_ST, "sIn");
|
|
1631
|
+
addEmpty(vNeces_S, vA3sg_ST);
|
|
1632
|
+
addTransition(vNeces_S, vA1pl_ST, "yIz");
|
|
1633
|
+
addTransition(vNeces_S, vA2pl_ST, "sInIz");
|
|
1634
|
+
addTransition(vNeces_S, vA3pl_ST, "lAr");
|
|
1635
|
+
addTransition(vNeces_S, vPastAfterTense_S, "ydI");
|
|
1636
|
+
addTransition(vNeces_S, vCond_S, "ysA");
|
|
1637
|
+
addTransition(vNeces_S, vNarrAfterTense_S, "ymIş");
|
|
1638
|
+
addTransition(vNeces_S, vCopBeforeA3pl_S, "dIr");
|
|
1639
|
+
addTransition(vNeces_S, vWhile_S, "yken");
|
|
1640
|
+
// A3pl before compound tense ("yapar-lar-dı"), Copula, and Past+Person+Cond ("geldinse")
|
|
1641
|
+
const prevNotPastNarrCond = not(prevStateIn([vPastAfterTense_S, vNarrAfterTense_S, vCond_S]));
|
|
1642
|
+
addTransition(vA3pl_ST, vPastAfterTense_ST, "dI", prevNotPastNarrCond);
|
|
1643
|
+
addTransition(vA3pl_ST, vNarrAfterTense_ST, "mIş", prevNotPastNarrCond);
|
|
1644
|
+
addTransition(vA3pl_ST, vCond_ST, "sA", prevNotPastNarrCond);
|
|
1645
|
+
const copWhileTenses = prevMorphemeIn([M.prog1, M.prog2, M.neces, M.fut, M.narr, M.aor]);
|
|
1646
|
+
addTransition(vA3pl_ST, vCop_ST, "dIr", copWhileTenses);
|
|
1647
|
+
addTransition(vA3pl_ST, vWhile_S, "ken", copWhileTenses);
|
|
1648
|
+
addTransition(vA1sg_ST, vCop_ST, "dIr", copWhileTenses);
|
|
1649
|
+
addTransition(vA2sg_ST, vCop_ST, "dIr", copWhileTenses);
|
|
1650
|
+
addTransition(vA3sg_ST, vCop_ST, ">dIr", copWhileTenses);
|
|
1651
|
+
addTransition(vA1pl_ST, vCop_ST, "dIr", copWhileTenses);
|
|
1652
|
+
addTransition(vA2pl_ST, vCop_ST, "dIr", copWhileTenses);
|
|
1653
|
+
addTransition(vCopBeforeA3pl_S, vA3pl_ST, "lAr");
|
|
1654
|
+
const prevPastNoCond = and(prevMorphemeIs(M.past), not(containsMorpheme(M.cond, M.desr)));
|
|
1655
|
+
addTransition(vA1sg_ST, vCondAfterPerson_ST, "sA", prevPastNoCond);
|
|
1656
|
+
addTransition(vA2sg_ST, vCondAfterPerson_ST, "sA", prevPastNoCond);
|
|
1657
|
+
addTransition(vA1pl_ST, vCondAfterPerson_ST, "sA", prevPastNoCond);
|
|
1658
|
+
addTransition(vA2pl_ST, vCondAfterPerson_ST, "sA", prevPastNoCond);
|
|
1659
|
+
// Compound auxiliary verb derivations
|
|
1660
|
+
addTransition(verbRoot_S, vEverSince_S, "+yAgel", cMultiVerb);
|
|
1661
|
+
addTransition(verbRoot_S, vRepeat_S, "+yAdur", cMultiVerb);
|
|
1662
|
+
addTransition(verbRoot_S, vRepeat_S, "+yAgör", cMultiVerb);
|
|
1663
|
+
addTransition(verbRoot_S, vAlmost_S, "+yAyaz", cMultiVerb);
|
|
1664
|
+
addTransition(verbRoot_S, vHastily_S, "+yIver", cMultiVerb);
|
|
1665
|
+
addTransition(verbRoot_S, vStay_S, "+yAkal", cMultiVerb);
|
|
1666
|
+
addTransition(verbRoot_S, vStart_S, "+yAkoy", cMultiVerb);
|
|
1667
|
+
for (const s of [vEverSince_S, vRepeat_S, vAlmost_S, vHastily_S, vStay_S, vStart_S]) {
|
|
1668
|
+
addEmpty(s, verbRoot_S);
|
|
1669
|
+
}
|
|
1670
|
+
// Adverbial verb derivations (converbs / zarf-fiiller)
|
|
1671
|
+
addTransition(vA3sg_ST, vAsIf_S, ">cAsInA", prevMorphemeIn([M.aor, M.narr]));
|
|
1672
|
+
addTransition(verbRoot_S, vWhen_S, "+yIncA");
|
|
1673
|
+
addTransition(verbRoot_S, vSinceDoingSo_S, "+yAlI");
|
|
1674
|
+
addTransition(verbRoot_S, vByDoingSo_S, "+yArAk");
|
|
1675
|
+
addTransition(verbRoot_S, vAdamantly_S, "+yAsIyA");
|
|
1676
|
+
addTransition(verbRoot_S, vAfterDoing_S, "+yIp");
|
|
1677
|
+
addTransition(verbRoot_S, vWithoutBeingAbleToHaveDoneSo_S, "+yAmAdAn");
|
|
1678
|
+
addTransition(verbRoot_S, vAsLongAs_S, ">dIkçA");
|
|
1679
|
+
addTransition(verbRoot_S, vWithoutHavingDoneSo_S, "mAdAn");
|
|
1680
|
+
addTransition(verbRoot_S, vWithoutHavingDoneSo_S, "mAksIzIn");
|
|
1681
|
+
for (const s of [
|
|
1682
|
+
vAsIf_S,
|
|
1683
|
+
vSinceDoingSo_S,
|
|
1684
|
+
vByDoingSo_S,
|
|
1685
|
+
vAdamantly_S,
|
|
1686
|
+
vAfterDoing_S,
|
|
1687
|
+
vWithoutBeingAbleToHaveDoneSo_S,
|
|
1688
|
+
vAsLongAs_S,
|
|
1689
|
+
vWithoutHavingDoneSo_S,
|
|
1690
|
+
vWhile_S,
|
|
1691
|
+
]) {
|
|
1692
|
+
addEmpty(s, advRoot_ST);
|
|
1693
|
+
}
|
|
1694
|
+
addEmpty(vWhen_S, advNounRoot_ST);
|
|
1695
|
+
// Post-processing: LastVowelDrop verbs like kavurmak -> kavr-ul (and block kavur-ul)
|
|
1696
|
+
addTransition(verbLastVowelDropModRoot_S, vPass_S, "Il");
|
|
1697
|
+
copyOutgoing(verbLastVowelDropUnmodRoot_S, verbRoot_S);
|
|
1698
|
+
removeTransitionsToMorpheme(verbLastVowelDropUnmodRoot_S, M.pass);
|
|
1699
|
+
// =========================================================================
|
|
1700
|
+
// 8. Standalone Question (mı/mi/mu/mü) & imek (idi/imiş/ise)
|
|
1701
|
+
// =========================================================================
|
|
1702
|
+
addEmpty(questionRoot_S, qPresent_S);
|
|
1703
|
+
addTransition(questionRoot_S, qPast_S, "ydI");
|
|
1704
|
+
addTransition(questionRoot_S, qNarr_S, "ymIş");
|
|
1705
|
+
addTransition(qPresent_S, qA1sg_ST, "yIm");
|
|
1706
|
+
addTransition(qPresent_S, qA2sg_ST, "sIn");
|
|
1707
|
+
addEmpty(qPresent_S, qA3sg_ST);
|
|
1708
|
+
addTransition(qPresent_S, qA1pl_ST, "+yIz");
|
|
1709
|
+
addTransition(qPresent_S, qA2pl_ST, "sInIz");
|
|
1710
|
+
addTransition(qPast_S, qA1sg_ST, "m");
|
|
1711
|
+
addTransition(qPast_S, qA2sg_ST, "n");
|
|
1712
|
+
addTransition(qPast_S, qA1pl_ST, "k");
|
|
1713
|
+
addTransition(qPast_S, qA2pl_ST, "InIz");
|
|
1714
|
+
addTransition(qPast_S, qA3pl_ST, "lAr");
|
|
1715
|
+
addEmpty(qPast_S, qA3sg_ST);
|
|
1716
|
+
addTransition(qNarr_S, qA1sg_ST, "Im");
|
|
1717
|
+
addTransition(qNarr_S, qA2sg_ST, "sIn");
|
|
1718
|
+
addTransition(qNarr_S, qA1pl_ST, "Iz");
|
|
1719
|
+
addTransition(qNarr_S, qA2pl_ST, "sInIz");
|
|
1720
|
+
addTransition(qNarr_S, qA3pl_ST, "lAr");
|
|
1721
|
+
addEmpty(qNarr_S, qA3sg_ST);
|
|
1722
|
+
const qRejectNoCopula = not(currentGroupContains(qPast_S));
|
|
1723
|
+
addTransition(qA1sg_ST, qCop_ST, "dIr", qRejectNoCopula);
|
|
1724
|
+
addTransition(qA2sg_ST, qCop_ST, "dIr", qRejectNoCopula);
|
|
1725
|
+
addTransition(qA3sg_ST, qCop_ST, ">dIr", qRejectNoCopula);
|
|
1726
|
+
addTransition(qA1pl_ST, qCop_ST, "dIr", qRejectNoCopula);
|
|
1727
|
+
addTransition(qA2pl_ST, qCop_ST, "dIr", qRejectNoCopula);
|
|
1728
|
+
addTransition(qPresent_S, qCopBeforeA3pl_S, ">dIr");
|
|
1729
|
+
addTransition(qCopBeforeA3pl_S, qA3pl_ST, "lAr");
|
|
1730
|
+
// Verb imek
|
|
1731
|
+
addTransition(imekRoot_S, imekPast_S, "di");
|
|
1732
|
+
addTransition(imekRoot_S, imekNarr_S, "miş");
|
|
1733
|
+
addTransition(imekRoot_S, imekCond_S, "se");
|
|
1734
|
+
addTransition(imekPast_S, imekA1sg_ST, "m");
|
|
1735
|
+
addTransition(imekPast_S, imekA2sg_ST, "n");
|
|
1736
|
+
addEmpty(imekPast_S, imekA3sg_ST);
|
|
1737
|
+
addTransition(imekPast_S, imekA1pl_ST, "k");
|
|
1738
|
+
addTransition(imekPast_S, imekA2pl_ST, "niz");
|
|
1739
|
+
addTransition(imekPast_S, imekA3pl_ST, "ler");
|
|
1740
|
+
addTransition(imekPast_S, imekCond_S, "yse");
|
|
1741
|
+
addTransition(imekNarr_S, imekA1sg_ST, "im");
|
|
1742
|
+
addTransition(imekNarr_S, imekA2sg_ST, "sin");
|
|
1743
|
+
addEmpty(imekNarr_S, imekA3sg_ST);
|
|
1744
|
+
addTransition(imekNarr_S, imekA1pl_ST, "iz");
|
|
1745
|
+
addTransition(imekNarr_S, imekA2pl_ST, "siniz");
|
|
1746
|
+
addTransition(imekNarr_S, imekA3pl_ST, "ler");
|
|
1747
|
+
addTransition(imekNarr_S, imekCond_S, "se");
|
|
1748
|
+
addTransition(imekCond_S, imekA1sg_ST, "m");
|
|
1749
|
+
addTransition(imekCond_S, imekA2sg_ST, "n");
|
|
1750
|
+
addEmpty(imekCond_S, imekA3sg_ST);
|
|
1751
|
+
addTransition(imekCond_S, imekA1pl_ST, "k");
|
|
1752
|
+
addTransition(imekCond_S, imekA2pl_ST, "niz");
|
|
1753
|
+
addTransition(imekCond_S, imekA3pl_ST, "ler");
|
|
1754
|
+
const imekRejectNoCopula = not(currentGroupContains(imekPast_S));
|
|
1755
|
+
addTransition(imekA1sg_ST, imekCop_ST, "dir", imekRejectNoCopula);
|
|
1756
|
+
addTransition(imekA2sg_ST, imekCop_ST, "dir", imekRejectNoCopula);
|
|
1757
|
+
addTransition(imekA3sg_ST, imekCop_ST, "tir", imekRejectNoCopula);
|
|
1758
|
+
addTransition(imekA1pl_ST, imekCop_ST, "dir", imekRejectNoCopula);
|
|
1759
|
+
addTransition(imekA2pl_ST, imekCop_ST, "dir", imekRejectNoCopula);
|
|
1760
|
+
addTransition(imekA3pl_ST, imekCop_ST, "dir", imekRejectNoCopula);
|
|
1761
|
+
// =========================================================================
|
|
1762
|
+
// Root state routing
|
|
1763
|
+
// =========================================================================
|
|
1764
|
+
const specialRootStates = new Map([
|
|
1765
|
+
["değil_Verb", nVerbDegil_S],
|
|
1766
|
+
["imek_Verb", imekRoot_S],
|
|
1767
|
+
["su_Noun", nounSuRoot_S],
|
|
1768
|
+
["akarsu_Noun", nounSuRoot_S],
|
|
1769
|
+
["öyle_Adv", advForVerbDeriv_ST],
|
|
1770
|
+
["böyle_Adv", advForVerbDeriv_ST],
|
|
1771
|
+
["şöyle_Adv", advForVerbDeriv_ST],
|
|
1772
|
+
]);
|
|
1773
|
+
function getRootState(item, phonetic) {
|
|
1774
|
+
const special = specialRootStates.get(item.key);
|
|
1775
|
+
if (special !== undefined)
|
|
1776
|
+
return special;
|
|
1777
|
+
if ((phonetic & PA_LAST_LETTER_DROPPED) !== 0) {
|
|
1778
|
+
return verbRoot_VowelDrop_S;
|
|
1779
|
+
}
|
|
1780
|
+
if ((item.attributes & RA_RECIPROCAL) !== 0) {
|
|
1781
|
+
return vImplicitRecipRoot_S;
|
|
1782
|
+
}
|
|
1783
|
+
if ((item.attributes & RA_REFLEXIVE) !== 0) {
|
|
1784
|
+
return vImplicitReflexRoot_S;
|
|
1785
|
+
}
|
|
1786
|
+
switch (item.primaryPos) {
|
|
1787
|
+
case "Noun":
|
|
1788
|
+
if ((item.attributes & RA_NO_SUFFIX) !== 0)
|
|
1789
|
+
return nounNoSuffix_S;
|
|
1790
|
+
if (item.secondaryPos === "ProperNoun")
|
|
1791
|
+
return nounProper_S;
|
|
1792
|
+
if (item.secondaryPos === "Abbreviation")
|
|
1793
|
+
return nounAbbrv_S;
|
|
1794
|
+
if ((item.attributes & RA_COMPOUND_P3SG_ROOT) !== 0)
|
|
1795
|
+
return nounCompoundRoot_S;
|
|
1796
|
+
return noun_S;
|
|
1797
|
+
case "Adj":
|
|
1798
|
+
return (item.attributes & RA_NO_SUFFIX) !== 0 ? adjNoSuffix_ST : adjectiveRoot_ST;
|
|
1799
|
+
case "Pron":
|
|
1800
|
+
switch (item.secondaryPos) {
|
|
1801
|
+
case "PersonalPron":
|
|
1802
|
+
return pronPers_S;
|
|
1803
|
+
case "DemonstrativePron":
|
|
1804
|
+
return pronDemons_S;
|
|
1805
|
+
case "QuestionPron":
|
|
1806
|
+
return pronQues_S;
|
|
1807
|
+
case "ReflexivePron":
|
|
1808
|
+
return pronReflex_S;
|
|
1809
|
+
default:
|
|
1810
|
+
return pronQuant_S;
|
|
1811
|
+
}
|
|
1812
|
+
case "Adv":
|
|
1813
|
+
return advRoot_ST;
|
|
1814
|
+
case "Conj":
|
|
1815
|
+
return conjRoot_ST;
|
|
1816
|
+
case "Ques":
|
|
1817
|
+
return questionRoot_S;
|
|
1818
|
+
case "Interj":
|
|
1819
|
+
return interjRoot_ST;
|
|
1820
|
+
case "Verb":
|
|
1821
|
+
return verbRoot_S;
|
|
1822
|
+
case "Det":
|
|
1823
|
+
return detRoot_ST;
|
|
1824
|
+
case "Postp":
|
|
1825
|
+
return postpRoot_ST;
|
|
1826
|
+
case "Num":
|
|
1827
|
+
return numeralRoot_ST;
|
|
1828
|
+
case "Dup":
|
|
1829
|
+
return dupRoot_ST;
|
|
1830
|
+
default:
|
|
1831
|
+
return noun_S;
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
cachedGraph = {
|
|
1835
|
+
noun_S,
|
|
1836
|
+
nounCompoundRoot_S,
|
|
1837
|
+
nounSuRoot_S,
|
|
1838
|
+
nounProper_S,
|
|
1839
|
+
nounAbbrv_S,
|
|
1840
|
+
nounNoSuffix_S,
|
|
1841
|
+
adjectiveRoot_ST,
|
|
1842
|
+
adjNoSuffix_ST,
|
|
1843
|
+
numeralRoot_ST,
|
|
1844
|
+
nVerbDegil_S,
|
|
1845
|
+
pronPers_S,
|
|
1846
|
+
pronPers_Mod_S,
|
|
1847
|
+
pronDemons_S,
|
|
1848
|
+
pronQuant_S,
|
|
1849
|
+
pronQuantModified_S,
|
|
1850
|
+
pronQues_S,
|
|
1851
|
+
pronReflex_S,
|
|
1852
|
+
advRoot_ST,
|
|
1853
|
+
advForVerbDeriv_ST,
|
|
1854
|
+
conjRoot_ST,
|
|
1855
|
+
interjRoot_ST,
|
|
1856
|
+
detRoot_ST,
|
|
1857
|
+
dupRoot_ST,
|
|
1858
|
+
postpRoot_ST,
|
|
1859
|
+
verbRoot_S,
|
|
1860
|
+
verbRoot_VowelDrop_S,
|
|
1861
|
+
verbLastVowelDropModRoot_S,
|
|
1862
|
+
verbLastVowelDropUnmodRoot_S,
|
|
1863
|
+
vImplicitRecipRoot_S,
|
|
1864
|
+
vImplicitReflexRoot_S,
|
|
1865
|
+
vDeYeRoot_S,
|
|
1866
|
+
questionRoot_S,
|
|
1867
|
+
imekRoot_S,
|
|
1868
|
+
getRootState,
|
|
1869
|
+
};
|
|
1870
|
+
return cachedGraph;
|
|
1871
|
+
}
|