-
Notifications
You must be signed in to change notification settings - Fork 0
/
hy_VERB.py
executable file
·1539 lines (1228 loc) · 49.7 KB
/
hy_VERB.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import re
class VerbParser:
conjugations = {
'infinitive': '-I',
'infinitive-caus': '-IC',
'infinitive-passive': '-IP',
'infinitive-caus-passive': '-ICP',
'infinitive-neg': '-IN',
'infinitive-neg-caus': '-INC',
'infinitive-neg-passive': '-INP',
'infinitive-neg-caus-passive': '-INCP',
'resultative_participle': '-RP',
'resultative_participle-caus': '-RPC',
'resultative_participle-passive': '-RPP',
'resultative_participle-caus-passive': '-RPCP',
'resultative_participle-neg': '-RPN',
'resultative_participle-neg-caus': '-RPNC',
'resultative_participle-neg-passive': '-RPNP',
'resultative_participle-neg-caus-passive': '-RPNCP',
'subject_participle': '-SP',
'subject_participle-caus': '-SPC',
'subject_participle-passive': '-SPP',
'subject_participle-caus-passive': '-SPCP',
'subject_participle-neg': '-SPN',
'subject_participle-neg-caus': '-SPNC',
'subject_participle-neg-passive': '-SPNP',
'subject_participle-neg-caus-passive': '-SPNCP',
'imperfective_converb': '-IC',
'imperfective_converb-caus': '-ICC',
'imperfective_converb-passive': '-ICP',
'imperfective_converb-caus-passive': '-ICCP',
'simultaneous_converb': '-SC',
'simultaneous_converb-caus': '-SCC',
'simultaneous_converb-passive': '-SCP',
'simultaneous_converb-caus-passive': '-SCCP',
'perfective_converb': '-PC',
'perfective_converb-caus': '-PCC',
'perfective_converb-passive': '-PCP',
'perfective_converb-caus-passive': '-PCCP',
'future_converb-i': '-FCI',
'future_converb-i-caus': '-FCIC',
'future_converb-i-passive': '-FCIP',
'future_converb-i-caus-passive': '-FCICP',
'future_converb-ii': '-FCII',
'future_converb-ii-caus': '-FCIIC',
'future_converb-ii-passive': '-FCIIP',
'future_converb-ii-caus-passive': '-FCIICP',
'connegative_converb': '-CC',
'connegative_converb-caus': '-CCC',
'connegative_converb-passive': '-CCP',
'connegative_converb-caus-passive': '-CCCP',
# +++++++++++++++
'indicative-aorist-singular-first': '~IASF',
'indicative-aorist-singular-second': '~IASS',
'indicative-aorist-singular-third': '~IAST',
'indicative-aorist-plural-first': '~IAPF',
'indicative-aorist-plural-second': '~IAPS',
'indicative-aorist-plural-third': '~IAPT',
'indicative-aorist-caus-singular-first': '~IACSF',
'indicative-aorist-caus-singular-second': '~IACSS',
'indicative-aorist-caus-singular-third': '~IACST',
'indicative-aorist-caus-plural-first': '~IACPF',
'indicative-aorist-caus-plural-second': '~IACPS',
'indicative-aorist-caus-plural-third': '~IACPT',
'indicative-aorist-passive-singular-first': '~IAPSF',
'indicative-aorist-passive-singular-second': '~IAPSS',
'indicative-aorist-passive-singular-third': '~IAPST',
'indicative-aorist-passive-plural-first': '~IAPPF',
'indicative-aorist-passive-plural-second': '~IAPPS',
'indicative-aorist-passive-plural-third': '~IAPPT',
'indicative-aorist-caus-passive-singular-first': '~IACPSF',
'indicative-aorist-caus-passive-singular-second': '~IACPSS',
'indicative-aorist-caus-passive-singular-third': '~IACPST',
'indicative-aorist-caus-passive-plural-first': '~IACPPF',
'indicative-aorist-caus-passive-plural-second': '~IACPPS',
'indicative-aorist-caus-passive-plural-third': '~IACPPT',
'indicative-aorist-neg-singular-first': '~IANSF',
'indicative-aorist-neg-singular-second': '~IANSS',
'indicative-aorist-neg-singular-third': '~IANST',
'indicative-aorist-neg-plural-first': '~IANPF',
'indicative-aorist-neg-plural-second': '~IANPS',
'indicative-aorist-neg-plural-third': '~IANPT',
'indicative-aorist-neg-caus-singular-first': '~IANCSF',
'indicative-aorist-neg-caus-singular-second': '~IANCSS',
'indicative-aorist-neg-caus-singular-third': '~IANCST',
'indicative-aorist-neg-caus-plural-first': '~IANCPF',
'indicative-aorist-neg-caus-plural-second': '~IANCPS',
'indicative-aorist-neg-caus-plural-third': '~IANCPT',
'indicative-aorist-neg-passive-singular-first': '~IANPSF',
'indicative-aorist-neg-passive-singular-second': '~IANPSS',
'indicative-aorist-neg-passive-singular-third': '~IANPST',
'indicative-aorist-neg-passive-plural-first': '~IANPPF',
'indicative-aorist-neg-passive-plural-second': '~IANPPS',
'indicative-aorist-neg-passive-plural-third': '~IANPPT',
'indicative-aorist-neg-caus-passive-singular-first': '~IANCPSF',
'indicative-aorist-neg-caus-passive-singular-second': '~IANCPSS',
'indicative-aorist-neg-caus-passive-singular-third': '~IANCPST',
'indicative-aorist-neg-caus-passive-plural-first': '~IANCPPF',
'indicative-aorist-neg-caus-passive-plural-second': '~IANCPPS',
'indicative-aorist-neg-caus-passive-plural-third': '~IANCPPT',
'subjunctive-future-singular-first': '~SFSF',
'subjunctive-future-singular-second': '~SFSS',
'subjunctive-future-singular-third': '~SFST',
'subjunctive-future-plural-first': '~SFPF',
'subjunctive-future-plural-second': '~SFPS',
'subjunctive-future-plural-third': '~SFPT',
'subjunctive-future-caus-singular-first': '~SFCSF',
'subjunctive-future-caus-singular-second': '~SFCSS',
'subjunctive-future-caus-singular-third': '~SFCST',
'subjunctive-future-caus-plural-first': '~SFCPF',
'subjunctive-future-caus-plural-second': '~SFCPS',
'subjunctive-future-caus-plural-third': '~SFCPT',
'subjunctive-future-passive-singular-first': '~SFPSF',
'subjunctive-future-passive-singular-second': '~SFPSS',
'subjunctive-future-passive-singular-third': '~SFPST',
'subjunctive-future-passive-plural-first': '~SFPPF',
'subjunctive-future-passive-plural-second': '~SFPPS',
'subjunctive-future-passive-plural-third': '~SFPPT',
'subjunctive-future-caus-passive-singular-first': '~SFCPSF',
'subjunctive-future-caus-passive-singular-second': '~SFCPSS',
'subjunctive-future-caus-passive-singular-third': '~SFCPST',
'subjunctive-future-caus-passive-plural-first': '~SFCPPF',
'subjunctive-future-caus-passive-plural-second': '~SFCPPS',
'subjunctive-future-caus-passive-plural-third': '~SFCPPT',
'subjunctive-future-neg-singular-first': '~SFNSF',
'subjunctive-future-neg-singular-second': '~SFNSS',
'subjunctive-future-neg-singular-third': '~SFNST',
'subjunctive-future-neg-plural-first': '~SFNPF',
'subjunctive-future-neg-plural-second': '~SFNPS',
'subjunctive-future-neg-plural-third': '~SFNPT',
'subjunctive-future-neg-caus-singular-first': '~SFNCSF',
'subjunctive-future-neg-caus-singular-second': '~SFNCSS',
'subjunctive-future-neg-caus-singular-third': '~SFNCST',
'subjunctive-future-neg-caus-plural-first': '~SFNCPF',
'subjunctive-future-neg-caus-plural-second': '~SFNCPS',
'subjunctive-future-neg-caus-plural-third': '~SFNCPT',
'subjunctive-future-neg-passive-singular-first': '~SFNPSF',
'subjunctive-future-neg-passive-singular-second': '~SFNPSS',
'subjunctive-future-neg-passive-singular-third': '~SFNPST',
'subjunctive-future-neg-passive-plural-first': '~SFNPPF',
'subjunctive-future-neg-passive-plural-second': '~SFNPPS',
'subjunctive-future-neg-passive-plural-third': '~SFNPPT',
'subjunctive-future-neg-caus-passive-singular-first': '~SFNCPSF',
'subjunctive-future-neg-caus-passive-singular-second': '~SFNCPSS',
'subjunctive-future-neg-caus-passive-singular-third': '~SFNCPST',
'subjunctive-future-neg-caus-passive-plural-first': '~SFNCPPF',
'subjunctive-future-neg-caus-passive-plural-second': '~SFNCPPS',
'subjunctive-future-neg-caus-passive-plural-third': '~SFNCPPT',
'subjunctive-future_perfect-singular-first': '~SFP_SF',
'subjunctive-future_perfect-singular-second': '~SFP_SS',
'subjunctive-future_perfect-singular-third': '~SFP_ST',
'subjunctive-future_perfect-plural-first': '~SFP_PF',
'subjunctive-future_perfect-plural-second': '~SFP_PS',
'subjunctive-future_perfect-plural-third': '~SFP_PT',
'subjunctive-future_perfect-caus-singular-first': '~SFP_CSF',
'subjunctive-future_perfect-caus-singular-second': '~SFP_CSS',
'subjunctive-future_perfect-caus-singular-third': '~SFP_CST',
'subjunctive-future_perfect-caus-plural-first': '~SFP_CPF',
'subjunctive-future_perfect-caus-plural-second': '~SFP_CPS',
'subjunctive-future_perfect-caus-plural-third': '~SFP_CPT',
'subjunctive-future_perfect-passive-singular-first': '~SFP_PSF',
'subjunctive-future_perfect-passive-singular-second': '~SFP_PSS',
'subjunctive-future_perfect-passive-singular-third': '~SFP_PST',
'subjunctive-future_perfect-passive-plural-first': '~SFP_PPF',
'subjunctive-future_perfect-passive-plural-second': '~SFP_PPS',
'subjunctive-future_perfect-passive-plural-third': '~SFP_PPT',
'subjunctive-future_perfect-caus-passive-singular-first': '~SFP_CPSF',
'subjunctive-future_perfect-caus-passive-singular-second': '~SFP_CPSS',
'subjunctive-future_perfect-caus-passive-singular-third': '~SFP_CPST',
'subjunctive-future_perfect-caus-passive-plural-first': '~SFP_CPPF',
'subjunctive-future_perfect-caus-passive-plural-second': '~SFP_CPPS',
'subjunctive-future_perfect-caus-passive-plural-third': '~SFP_CPPT',
'subjunctive-future_perfect-neg-singular-first': '~SFP_NSF',
'subjunctive-future_perfect-neg-singular-second': '~SFP_NSS',
'subjunctive-future_perfect-neg-singular-third': '~SFP_NST',
'subjunctive-future_perfect-neg-plural-first': '~SFP_NPF',
'subjunctive-future_perfect-neg-plural-second': '~SFP_NPS',
'subjunctive-future_perfect-neg-plural-third': '~SFP_NPT',
'subjunctive-future_perfect-neg-caus-singular-first': '~SFP_NCSF',
'subjunctive-future_perfect-neg-caus-singular-second': '~SFP_NCSS',
'subjunctive-future_perfect-neg-caus-singular-third': '~SFP_NCST',
'subjunctive-future_perfect-neg-caus-plural-first': '~SFP_NCPF',
'subjunctive-future_perfect-neg-caus-plural-second': '~SFP_NCPS',
'subjunctive-future_perfect-neg-caus-plural-third': '~SFP_NCPT',
'subjunctive-future_perfect-neg-passive-singular-first': '~SFP_NPSF',
'subjunctive-future_perfect-neg-passive-singular-second': '~SFP_NPSS',
'subjunctive-future_perfect-neg-passive-singular-third': '~SFP_NPST',
'subjunctive-future_perfect-neg-passive-plural-first': '~SFP_NPPF',
'subjunctive-future_perfect-neg-passive-plural-second': '~SFP_NPPS',
'subjunctive-future_perfect-neg-passive-plural-third': '~SFP_NPPT',
'subjunctive-future_perfect-neg-caus-passive-singular-first': '~SFP_NCPSF',
'subjunctive-future_perfect-neg-caus-passive-singular-second': '~SFP_NCPSS',
'subjunctive-future_perfect-neg-caus-passive-singular-third': '~SFP_NCPST',
'subjunctive-future_perfect-neg-caus-passive-plural-first': '~SFP_NCPPF',
'subjunctive-future_perfect-neg-caus-passive-plural-second': '~SFP_NCPPS',
'subjunctive-future_perfect-neg-caus-passive-plural-third': '~SFP_NCPPT',
'conditional-future-singular-first': '~CFSF',
'conditional-future-singular-second': '~CFSS',
'conditional-future-singular-third': '~CFST',
'conditional-future-plural-first': '~CFPF',
'conditional-future-plural-second': '~CFPS',
'conditional-future-plural-third': '~CFPT',
'conditional-future-caus-singular-first': '~CFCSF',
'conditional-future-caus-singular-second': '~CFCSS',
'conditional-future-caus-singular-third': '~CFCST',
'conditional-future-caus-plural-first': '~CFCPF',
'conditional-future-caus-plural-second': '~CFCPS',
'conditional-future-caus-plural-third': '~CFCPT',
'conditional-future-passive-singular-first': '~CFPSF',
'conditional-future-passive-singular-second': '~CFPSS',
'conditional-future-passive-singular-third': '~CFPST',
'conditional-future-passive-plural-first': '~CFPPF',
'conditional-future-passive-plural-second': '~CFPPS',
'conditional-future-passive-plural-third': '~CFPPT',
'conditional-future-caus-passive-singular-first': '~CFCPSF',
'conditional-future-caus-passive-singular-second': '~CFCPSS',
'conditional-future-caus-passive-singular-third': '~CFCPST',
'conditional-future-caus-passive-plural-first': '~CFCPPF',
'conditional-future-caus-passive-plural-second': '~CFCPPS',
'conditional-future-caus-passive-plural-third': '~CFCPPT',
'conditional-future_perfect-singular-first': '~CFP_SF',
'conditional-future_perfect-singular-second': '~CFP_SS',
'conditional-future_perfect-singular-third': '~CFP_ST',
'conditional-future_perfect-plural-first': '~CFP_PF',
'conditional-future_perfect-plural-second': '~CFP_PS',
'conditional-future_perfect-plural-third': '~CFP_PT',
'conditional-future_perfect-caus-singular-first': '~CFP_CSF',
'conditional-future_perfect-caus-singular-second': '~CFP_CSS',
'conditional-future_perfect-caus-singular-third': '~CFP_CST',
'conditional-future_perfect-caus-plural-first': '~CFP_CPF',
'conditional-future_perfect-caus-plural-second': '~CFP_CPS',
'conditional-future_perfect-caus-plural-third': '~CFP_CPT',
'conditional-future_perfect-passive-singular-first': '~CFP_PSF',
'conditional-future_perfect-passive-singular-second': '~CFP_PSS',
'conditional-future_perfect-passive-singular-third': '~CFP_PST',
'conditional-future_perfect-passive-plural-first': '~CFP_PPF',
'conditional-future_perfect-passive-plural-second': '~CFP_PPS',
'conditional-future_perfect-passive-plural-third': '~CFP_PPT',
'conditional-future_perfect-caus-passive-singular-first': '~CFP_CPSF',
'conditional-future_perfect-caus-passive-singular-second': '~CFP_CPSS',
'conditional-future_perfect-caus-passive-singular-third': '~CFP_CPST',
'conditional-future_perfect-caus-passive-plural-first': '~CFP_CPPF',
'conditional-future_perfect-caus-passive-plural-second': '~CFP_CPPS',
'conditional-future_perfect-caus-passive-plural-third': '~CFP_CPPT',
'imperative-none-singular-second': '~INSS',
'imperative-none-plural-second': '~INPS',
'imperative-none-caus-singular-second': '~INCSS',
'imperative-none-caus-plural-second': '~INCPS',
'imperative-none-passive-singular-second': '~INPSS',
'imperative-none-passive-plural-second': '~INPPS',
'imperative-none-caus-passive-singular-second': '~INCPSS',
'imperative-none-caus-passive-plural-second': '~INCPPS',
}
@staticmethod
def elal( word ):
return word[:-2]
@staticmethod
def neg_ch( word_list ):
return ['չ{}'.format(word) for word in word_list]
def parse_word( self, type ):
func_name = self.conjugations.get(type)
try:
if func_name[:1] == '-':
func = getattr(self, '{}0'.format(func_name[1:]))
else:
func = getattr(self, '{}1'.format(func_name[1:]))
except:
if 'neg' in type.split('-'):
norm_func = '-'.join(filter(lambda x: True if x != 'neg' else False, type.split('-')))
n_func_name = self.conjugations.get(norm_func)
try:
if n_func_name[:1] == '-':
norm_func = getattr(self, '{}0'.format(n_func_name[1:]))
else:
norm_func = getattr(self, '{}1'.format(n_func_name[1:]))
except:
return False
else:
word = self.neg_ch(norm_func())
return {
'word': word,
'conj': type,
}
else:
return False
else:
word = func()
return {
'word': word,
'conj': type,
}
def parse( self, type=False ):
if type:
if not self.conjugations.get(type):
raise KeyError
else:
parsed = self.parse_word(type)
if parsed:
return parsed
else:
c_arr = []
for c in self.conjugations:
parsed = self.parse_word(c)
if parsed:
c_arr.append(parsed)
return c_arr
def word_attr( self, attr ):
for u, v in self.attr:
if u == attr:
return v
return ''
def word_attr_k( self, attr ):
for u, v in self.attr:
if attr == v:
return True
return False
def word_attr_val( self, attr ):
for u, v in self.attr:
if attr in v:
return v.split('=')[-1]
return False
def __init__( self, word, attr, **kwargs ):
self.not_parsed_attr = attr
self.word = word
attr_list = re.split(r'\|(?=\|*)', attr[2:-2])
for i in range(len(attr_list)-1, -1, -1):
if attr_list[i] == '':
attr_list[i+1] = '|' + attr_list[i+1]
del attr_list[i]
for i in range(len(attr_list)):
attr_list[i] = '|' + attr_list[i]
attributes = []
for i in attr_list:
attributes.append((i.count('|'), re.sub( r'\|', '', i)))
self.attr = attributes
class VerbElParser(VerbParser):
def indicative_aorist_st( self, ending, caus=False, passive=False ):
root = self.elal(self.word)
if root[-2:] == 'ցն':
cut_end = 'ancn'
stem = root[:-2]
elif root[-1] == 'ն' or root[-1] == 'չ':
cut_end = 'nch'
stem = root[:-1]
else:
cut_end = None
stem = root
if passive and cut_end != 'ancn':
p = 'վ'
else:
p = ''
if caus:
if cut_end == 'ancn':
c = ''
elif cut_end == 'nch':
c = 'ցր'
elif cut_end == None:
c = 'եցր'
if passive:
if cut_end == 'ancn':
c_p = ''
elif cut_end == 'nch':
c_p = 'ց'
elif cut_end == None:
c_p = 'եց'
else:
c_p = ''
else:
c = c_p = ''
if cut_end == 'ancn':
if passive:
stem_c = 'ցվ'
else:
stem_c = 'ցր'
if cut_end == 'nch':
if not passive and not caus:
end = [ending[1]]
elif passive and not caus:
end = ['']
elif not passive and caus:
end = [ending[0], ending[2]]
else:
end = [ending[2]]
elif cut_end == 'ancn':
if not passive and not caus:
end = [stem_c + ending[2], stem_c + ending[0]]
elif passive and not caus:
end = [stem_c + ending[2]]
elif not passive and caus:
end = []
else:
end = []
elif cut_end == None:
if not passive and not caus:
end = [ending[2]]
elif passive and not caus:
end = [ending[2]]
elif not passive and caus:
end = [ending[0]]
else:
end = [ending[2]]
output = []
for e in end:
if e:
output.append('{stem}{c}{p}{e}'.format(stem=stem, c=(c_p if c_p else c), p=p, e=e))
return output
def imperative_none_st( self, ending, caus=False, passive=False ):
root = self.elal(self.word)
stem = root
if root[-2:] == 'ցն':
stem = stem[:-2]
cut_end = 'ancn'
elif root[-1] == 'ն' or root[-1] == 'չ':
stem = stem[:-1]
cut_end = 'nch'
else:
cut_end = None
if passive:
p = 'վ'
else:
p = ''
if caus:
if cut_end == 'ancn':
c = 'ցր'
elif cut_end == 'nch':
c = 'ցր'
elif cut_end == None:
c = 'եցր'
if passive:
if cut_end == 'ancn':
c_p = 'եց'
elif cut_end == 'nch':
c_p = 'ց'
elif cut_end == None:
c_p = 'եց'
else:
c_p = ''
else:
c = c_p = ''
if cut_end == 'ancn':
end = ending
elif cut_end == 'nch':
end = ending
elif cut_end == None:
end = ending
output = []
if end:
output.append('{stem}{c}{p}{e}'.format(stem=stem, c=(c_p if c_p else c), p=p, e=end))
return output
def standard_st( self, ending, caus=False, passive=False, conditional=False ):
root = self.elal(self.word)
if root[-2:] == 'ցն':
cut_end = 'ancn'
elif root[-1] == 'ն' or root[-1] == 'չ':
cut_end = 'nch'
else:
cut_end = None
stem = root
if passive:
p = 'վ'
else:
p = ''
if caus:
if cut_end == 'ancn':
c = 'եցն'
elif cut_end == 'nch':
stem = stem[:-1]
c = 'ցն'
elif cut_end == None:
c = 'եցն'
if passive:
if cut_end == 'ancn':
c_p = 'եց'
elif cut_end == 'nch':
c_p = 'ց'
elif cut_end == None:
c_p = 'եց'
else:
c_p = ''
else:
c = c_p = ''
if cut_end == 'ancn':
if passive and not caus:
end = ''
else:
end = ending
elif cut_end == 'nch':
if passive and not caus:
end = ''
else:
end = ending
elif cut_end == None:
end = ending
output = []
if end:
output.append('{cond}{stem}{c}{p}{e}'.format(cond='կ' if conditional else '', stem=stem, c=(c_p if c_p else c), p=p, e=end))
return output
def IASF1( self ):
return self.indicative_aorist_st(['ի', 'ա', 'եցի'])
def IASS1( self ):
return self.indicative_aorist_st(['իր', 'ար', 'եցիր'])
def IAST1( self ):
return self.indicative_aorist_st(['եց', 'ավ', 'եց'])
def IAPF1( self ):
return self.indicative_aorist_st(['ինք', 'անք', 'եցինք'])
def IAPS1( self ):
return self.indicative_aorist_st(['իք', 'աք', 'եցիք'])
def IAPT1( self ):
return self.indicative_aorist_st(['ին', 'ան', 'եցին'])
def IACSF1( self ):
return self.indicative_aorist_st(['ի', 'ա', 'եցի'], caus=True)
def IACSS1( self ):
return self.indicative_aorist_st(['իր', 'ար', 'եցիր'], caus=True)
def IACST1( self ):
return self.indicative_aorist_st(['եց', 'ավ', 'եց'], caus=True)
def IACPF1( self ):
return self.indicative_aorist_st(['ինք', 'անք', 'եցինք'], caus=True)
def IACPS1( self ):
return self.indicative_aorist_st(['իք', 'աք', 'եցիք'], caus=True)
def IACPT1( self ):
return self.indicative_aorist_st(['ին', 'ան', 'եցին'], caus=True)
def IAPSF1( self ):
return self.indicative_aorist_st(['ի', 'ա', 'եցի'], passive=True)
def IAPSS1( self ):
return self.indicative_aorist_st(['իր', 'ար', 'եցիր'], passive=True)
def IAPST1( self ):
return self.indicative_aorist_st(['եց', 'ավ', 'եց'], passive=True)
def IAPPF1( self ):
return self.indicative_aorist_st(['ինք', 'անք', 'եցինք'], passive=True)
def IAPPS1( self ):
return self.indicative_aorist_st(['իք', 'աք', 'եցիք'], passive=True)
def IAPPT1( self ):
return self.indicative_aorist_st(['ին', 'ան', 'եցին'], passive=True)
def IACPSF1( self ):
return self.indicative_aorist_st(['ի', 'ա', 'եցի'], caus=True, passive=True)
def IACPSS1( self ):
return self.indicative_aorist_st(['իր', 'ար', 'եցիր'], caus=True, passive=True)
def IACPST1( self ):
return self.indicative_aorist_st(['եց', 'ավ', 'եց'], caus=True, passive=True)
def IACPPF1( self ):
return self.indicative_aorist_st(['ինք', 'անք', 'եցինք'], caus=True, passive=True)
def IACPPS1( self ):
return self.indicative_aorist_st(['իք', 'աք', 'եցիք'], caus=True, passive=True)
def IACPPT1( self ):
return self.indicative_aorist_st(['ին', 'ան', 'եցին'], caus=True, passive=True)
def SFSF1( self ):
return self.standard_st('եմ')
def SFSS1( self ):
return self.standard_st('ես')
def SFST1( self ):
return self.standard_st('ի')
def SFPF1( self ):
return self.standard_st('ենք')
def SFPS1( self ):
return self.standard_st('եք')
def SFPT1( self ):
return self.standard_st('են')
def SFCSF1( self ):
return self.standard_st('եմ', caus=True)
def SFCSS1( self ):
return self.standard_st('ես', caus=True)
def SFCST1( self ):
return self.standard_st('ի', caus=True)
def SFCPF1( self ):
return self.standard_st('ենք', caus=True)
def SFCPS1( self ):
return self.standard_st('եք', caus=True)
def SFCPT1( self ):
return self.standard_st('են', caus=True)
def SFPSF1( self ):
return self.standard_st('եմ', passive=True)
def SFPSS1( self ):
return self.standard_st('ես', passive=True)
def SFPST1( self ):
return self.standard_st('ի', passive=True)
def SFPPF1( self ):
return self.standard_st('ենք', passive=True)
def SFPPS1( self ):
return self.standard_st('եք', passive=True)
def SFPPT1( self ):
return self.standard_st('են', passive=True)
def SFCPSF1( self ):
return self.standard_st('եմ', caus=True, passive=True)
def SFCPSS1( self ):
return self.standard_st('ես', caus=True, passive=True)
def SFCPST1( self ):
return self.standard_st('ի', caus=True, passive=True)
def SFCPPF1( self ):
return self.standard_st('ենք', caus=True, passive=True)
def SFCPPS1( self ):
return self.standard_st('եք', caus=True, passive=True)
def SFCPPT1( self ):
return self.standard_st('են', caus=True, passive=True)
def SFP_SF1( self ):
return self.standard_st('եի')
def SFP_SS1( self ):
return self.standard_st('եիր')
def SFP_ST1( self ):
return self.standard_st('եր')
def SFP_PF1( self ):
return self.standard_st('եինք')
def SFP_PS1( self ):
return self.standard_st('եիք')
def SFP_PT1( self ):
return self.standard_st('եին')
def SFP_CSF1( self ):
return self.standard_st('եի', caus=True)
def SFP_CSS1( self ):
return self.standard_st('եիր', caus=True)
def SFP_CST1( self ):
return self.standard_st('եր', caus=True)
def SFP_CPF1( self ):
return self.standard_st('եինք', caus=True)
def SFP_CPS1( self ):
return self.standard_st('եիք', caus=True)
def SFP_CPT1( self ):
return self.standard_st('եին', caus=True)
def SFP_PSF1( self ):
return self.standard_st('եի', passive=True)
def SFP_PSS1( self ):
return self.standard_st('եիր', passive=True)
def SFP_PST1( self ):
return self.standard_st('եր', passive=True)
def SFP_PPF1( self ):
return self.standard_st('եինք', passive=True)
def SFP_PPS1( self ):
return self.standard_st('եիք', passive=True)
def SFP_PPT1( self ):
return self.standard_st('եին', passive=True)
def SFP_CPSF1( self ):
return self.standard_st('եի', caus=True, passive=True)
def SFP_CPSS1( self ):
return self.standard_st('եիր', caus=True, passive=True)
def SFP_CPST1( self ):
return self.standard_st('եր', caus=True, passive=True)
def SFP_CPPF1( self ):
return self.standard_st('եինք', caus=True, passive=True)
def SFP_CPPS1( self ):
return self.standard_st('եիք', caus=True, passive=True)
def SFP_CPPT1( self ):
return self.standard_st('եին', caus=True, passive=True)
def CFSF1( self ):
return self.standard_st('եմ', conditional=True)
def CFSS1( self ):
return self.standard_st('ես', conditional=True)
def CFST1( self ):
return self.standard_st('ի', conditional=True)
def CFPF1( self ):
return self.standard_st('ենք', conditional=True)
def CFPS1( self ):
return self.standard_st('եք', conditional=True)
def CFPT1( self ):
return self.standard_st('են', conditional=True)
def CFCSF1( self ):
return self.standard_st('եմ', caus=True, conditional=True)
def CFCSS1( self ):
return self.standard_st('ես', caus=True, conditional=True)
def CFCST1( self ):
return self.standard_st('ի', caus=True, conditional=True)
def CFCPF1( self ):
return self.standard_st('ենք', caus=True, conditional=True)
def CFCPS1( self ):
return self.standard_st('եք', caus=True, conditional=True)
def CFCPT1( self ):
return self.standard_st('են', caus=True, conditional=True)
def CFPSF1( self ):
return self.standard_st('եմ', passive=True, conditional=True)
def CFPSS1( self ):
return self.standard_st('ես', passive=True, conditional=True)
def CFPST1( self ):
return self.standard_st('ի', passive=True, conditional=True)
def CFPPF1( self ):
return self.standard_st('ենք', passive=True, conditional=True)
def CFPPS1( self ):
return self.standard_st('եք', passive=True, conditional=True)
def CFPPT1( self ):
return self.standard_st('են', passive=True, conditional=True)
def CFCPSF1( self ):
return self.standard_st('եմ', caus=True, passive=True, conditional=True)
def CFCPSS1( self ):
return self.standard_st('ես', caus=True, passive=True, conditional=True)
def CFCPST1( self ):
return self.standard_st('ի', caus=True, passive=True, conditional=True)
def CFCPPF1( self ):
return self.standard_st('ենք', caus=True, passive=True, conditional=True)
def CFCPPS1( self ):
return self.standard_st('եք', caus=True, passive=True, conditional=True)
def CFCPPT1( self ):
return self.standard_st('են', caus=True, passive=True, conditional=True)
def CFP_SF1( self ):
return self.standard_st('եի', conditional=True)
def CFP_SS1( self ):
return self.standard_st('եիր', conditional=True)
def CFP_ST1( self ):
return self.standard_st('եր', conditional=True)
def CFP_PF1( self ):
return self.standard_st('եինք', conditional=True)
def CFP_PS1( self ):
return self.standard_st('եիք', conditional=True)
def CFP_PT1( self ):
return self.standard_st('եին', conditional=True)
def CFP_CSF1( self ):
return self.standard_st('եի', caus=True, conditional=True)
def CFP_CSS1( self ):
return self.standard_st('եիր', caus=True, conditional=True)
def CFP_CST1( self ):
return self.standard_st('եր', caus=True, conditional=True)
def CFP_CPF1( self ):
return self.standard_st('եինք', caus=True, conditional=True)
def CFP_CPS1( self ):
return self.standard_st('եիք', caus=True, conditional=True)
def CFP_CPT1( self ):
return self.standard_st('եին', caus=True, conditional=True)
def CFP_PSF1( self ):
return self.standard_st('եի', passive=True, conditional=True)
def CFP_PSS1( self ):
return self.standard_st('եիր', passive=True, conditional=True)
def CFP_PST1( self ):
return self.standard_st('եր', passive=True, conditional=True)
def CFP_PPF1( self ):
return self.standard_st('եինք', passive=True, conditional=True)
def CFP_PPS1( self ):
return self.standard_st('եիք', passive=True, conditional=True)
def CFP_PPT1( self ):
return self.standard_st('եին', passive=True, conditional=True)
def CFP_CPSF1( self ):
return self.standard_st('եի', caus=True, passive=True, conditional=True)
def CFP_CPSS1( self ):
return self.standard_st('եիր', caus=True, passive=True, conditional=True)
def CFP_CPST1( self ):
return self.standard_st('եր', caus=True, passive=True, conditional=True)
def CFP_CPPF1( self ):
return self.standard_st('եինք', caus=True, passive=True, conditional=True)
def CFP_CPPS1( self ):
return self.standard_st('եիք', caus=True, passive=True, conditional=True)
def CFP_CPPT1( self ):
return self.standard_st('եին', caus=True, passive=True, conditional=True)
def INSS1( self ):
return self.imperative_none_st('իր')
def INPS1( self ):
return self.imperative_none_st('եք')
def INCSS1( self ):
return self.imperative_none_st('ու', caus=True)
def INCPS1( self ):
return self.imperative_none_st('եք', caus=True)
def INPSS1( self ):
return self.imperative_none_st('իր', passive=True)
def INPPS1( self ):
return self.imperative_none_st('եք', passive=True)
def INCPSS1( self ):
return self.imperative_none_st('իր', caus=True, passive=True)
def INCPPS1( self ):
return self.imperative_none_st('եք', caus=True, passive=True)
class VerbAlParser(VerbParser):
def indicative_aorist_st( self, ending, caus=False, passive=False ):
root = self.elal(self.word)
if root[-2:] == 'ան':
cut_end = 'an'
stem = root[:-2]
elif root[-2:] == 'են':
cut_end = 'en'
stem = root[:-2]
else:
cut_end = None
stem = root
if passive:
p = 'վ'
else:
p = ''
if caus:
if cut_end == 'an':
c = 'ացր'
elif cut_end == 'en':
c = 'եցր'
elif cut_end == None:
c = 'ացր'
if passive:
if cut_end == 'an':
c_p = 'աց'
elif cut_end == 'en':
c_p = 'եց'
elif cut_end == None:
c_p = 'աց'
else:
c_p = ''
else:
c = c_p = ''
if cut_end == 'an':
if not passive and not caus:
end = [ending[1]]
elif passive and not caus:
end = ['']
elif not passive and caus:
end = [ending[0], ending[1]]
else:
end = [ending[0]]
elif cut_end == 'en':
if not passive and not caus:
end = [ending[0]]
elif passive and not caus:
end = ['']
elif not passive and caus:
end = [ending[0], ending[1]]
else:
end = [ending[0]]
elif cut_end == None:
if not passive and not caus:
end = [ending[2]]
elif passive and not caus:
end = ['']
elif not passive and caus:
end = [ending[0], ending[1]]
else:
end = [ending[0]]
output = []
for e in end:
if e:
output.append('{stem}{c}{p}{e}'.format(stem=stem, c=(c_p if c_p else c), p=p, e=e))
return output
def imperative_none_st( self, ending, caus=False, passive=False ):
root = self.elal(self.word)
if root[-2:] == 'ան':
stem = root[:-2]
cut_end = 'an'
elif root[-2:] == 'են':
stem = root[:-2]
cut_end = 'en'
else:
cut_end = None
stem = root
if passive:
p = 'վ'
else: