-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathzhong.tdl
2992 lines (2456 loc) · 101 KB
/
zhong.tdl
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
;;; -*- Mode: TDL; Coding: utf-8 -*-
;;; Zhong [|] Grammar
;;;
;;; This file was first created on:
;;; Tue Jun 30 19:43:27 UTC 2009
;;; based on Matrix customization system version of:
;;; Tue Jun 23 20:36:41 UTC 2009
;;;
;;; Authors: Luis Morgado da Costa, Francis Bond, Fan Zhenzhen,
;;; Sanghoun Song, Nat Hillard, Dan Flickinger, Chunlei Yang
;;;
;
; ta 20 sui OK
; ta SHI 20 sui ok but it's a confirmation. (
; zhege pingguo 10 kuai
; zhege pingguo 10 kuai qian
; zhege pingguo 10 kuai reminbi
; women 3 ge ren. OK
; women shi 3 ge ren. OK it's emphasize
; tamen 3 ge feichan piaoliang de ren. ; less... ok feels like a subject of something. but yeah context allows: e.g. Nimen jige piaoliang de ren, jige bupiaoliang de ren? women 3 ge feichan piaoliang de ren 3 ge bu piaoliang de ren
;
;
;
;数词做谓语
; 1. 日期 jintian + zhouyi // xinqisan. // jintian zhoumo // All OK
; 2. 年龄 ta 23 sui
; 3. 价格 zhe ge pingguo 3 kuai qian
; 4. shijian xianzai ba dian zhong
;
;
; also
; zhe ge bisa 六 场. (???? proably weird... no)
; zhe ge dangao you ji kuai ? ok
; zhe ge dangao ji kuai ? not ok
; zhe ge dangao 3 kuai. not ok
; 你几个人?
; 这个蛋糕几块? not ok
;============================================================================
; IMPLEMENTATION NOTES:
;============================================================================
; This grammar has had multiple authors over the years. The early stages of
; implementation seriously lacked documentation. This is an attempt to
; collect some insights or design choices that should be taken into
; consideration by future developers.
;============================================================================
;============================================================================
; HEAD FEATURES AND THEIR USAGES:
;============================================================================
; >>> [LIGHT luk] / [LIGHT +] / [LIGHT -]
;
; LIGHT is first introduced by the matrix with the following piece of
; documentation "is used to distinguish shorter words from longer ones, or
; constituents which are lexical or nearly so from larger phrases.
; It is inspired by the work of Abeille and Godard (e.g., 2003)
;
; By default, from the matrix:
; 'lex-synsem' are LIGHT + and 'phr-synsem' are LIGHT -
;
; [LIGHT -] is now also being introduced to Noun-Noun compounds to block the
; attachment of morphemes like 们 after the compound has been formed.
;
;
; >>> [CARDINAL bool] / [CARDINAL +] / [CARDINAL -]
;
; This is currently only used for types with head value 'num', marking them
; as [CARDINAL +]. As such, this is currently another way to select for
; numbers.
;============================================================================
;============================================================================
; SYNSEM FEATURES AND THEIR USAGES:
;============================================================================
;============================================================================
;; SSH 2014-09-04: The style feature for efficient generation
sign :+
[ STYLE style,
IDIOMATIC luk ].
;============================================================================
; STYLE
;============================================================================
; Style
; ---- strict
;
; ---- robust:
; ---- spoken
; ---- unproductive
; ---- dialect
;============================================================================
style := avm & [ WRITTEN luk ].
strict := style & [ WRITTEN + ].
robust := style.
spoken := robust & [ WRITTEN - ].
mal := robust.
dialect := robust.
;============================================================================
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WE CAN SELECT THINGS, e.g. COMPS, WITH FCHAR !!! (WORKS)
; SO INSTEAD OF FCHAR, WE COULD HAVE THE WHOLE WORD
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; test_不_v := v_np_le &
; """
; This is a test to see if we could CHAR.FCHAR to select things!
; DELETE ME ASAP
; """
; [ STEM < "不" >,
; SYNSEM.LOCAL.CAT.HEAD [ CHAR [ FCHAR "不", LENGTH one ] ],
; SYNSEM [ LOCAL.CAT.VAL.COMPS < [ LOCAL.CAT.HEAD.CHAR.FCHAR "猫" ] >,
; LKEYS.KEYREL.PRED "_不_v_2_rel" ],
; TRAITS native_token_list ].
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
lex-rule :+
[ STYLE #style,
DTR.STYLE #style ].
basic-unary-phrase :+
[ STYLE #style,
SYNSEM [ PAREN #paren,
PUNCTUATED #punc ],
ARGS < [ STYLE #style,
SYNSEM [ PAREN #paren,
PUNCTUATED #punc ] ] > ].
synsem :+
"""
;; SSH 2014-12-19: BOUND is introduced. Lexical items with [BOUND +]
;; cannot be combined with the other of itself.
;; POSTCOMP is a feature to be used on HEAD to indicate the COMP's position is after the head.
;; CH is defined in the COMPS list to indicate the position of COMPS: CH+ == COMP before HEAD, CH- == COMP after HEAD, allowing HEAD to have one COMP before and one COMP after
CLASSIF (THIS IS A TEST TO TRY TO MOVE IT AWAY FROM HEAD FEATURE), CURRENTLY WE'LL HAVE 2
"""
[ PUNCTUATED luk,
INTERJECTED luk,
PAREN luk,
ASPECTED luk,
POSTCOMP luk,
CH luk,
BARE luk,
SPART spart,
UTTERED luk,
CLASSIF bool, ;;;; TESTING
BOUND luk ].
;============================================================================
; SENTENCE FINAL PARTICLES
;============================================================================
spart := avm.
not-crs := spart.
not-ma := spart.
crs := not-ma.
ma := not-crs.
no-spart := spart.
not-crs-not-ma := not-crs & not-ma.
;; SSH 2014-10-24: for chart mapping
;; MATRIX REDEFINITION
;; make STEM of type orthog(raphy) to pass up from/to/form
sign-min := avm &
[ STEM orthog ].
orthog := cons &
[ FROM string,
TO string ].
;; SSH 2015-01-26: compound lexical items
cpd := icons.
;noun-noun := cpd.
pred-pred := cpd.
rslt := pred-pred.
parallel := pred-pred.
card_rel := named_rel.
symbol_rel := named_rel.
; Constant Argument relation
carg-relation := arg0-relation &
[ CARG string ].
card-relation := carg-relation & arg1-relation &
"""
Cardinal Relation.
[ARG0 individual] means that it is unspecified for 'ref-ind' or an 'event'.
These are subspecified when it becomes either a noun or an adj-like number.
"""
[ PRED card_rel,
ARG0 individual ].
named-relation := noun-relation & carg-relation &
[ PRED named_rel ].
symbol-relation := named-relation & arg1-relation &
[ PRED symbol_rel ].
q_rel := predsort.
every_q_rel := q_rel.
exist_q_rel := q_rel.
some_q_rel := exist_q_rel.
many_q_rel := exist_q_rel.
proper_q_rel := q_rel.
pronoun_q_rel := q_rel.
which_q_rel := q_rel.
_how-many_q_rel := q_rel.
generic_q_rel := q_rel.
related_p_rel := predsort.
compound_p_rel := related_p_rel.
;poss_p_rel := related_p_rel.
dem_rel := predsort.
prox_dem_q_rel := dem_rel.
dist_dem_q_rel := dem_rel.
general_n_rel := predsort.
pron_rel := general_n_rel.
generic_n_rel := general_n_rel.
thing_n_rel := generic_n_rel.
place_n_rel := generic_n_rel.
person_n_rel := generic_n_rel.
time_n_rel := generic_n_rel & day_or_month_or_time_rel.
day_or_month_or_time_rel := named_rel.
month_n_rel := day_or_month_or_time_rel.
day_n_rel := day_or_month_or_time_rel.
date_n_rel := day_or_month_or_time_rel.
;;; used in fragments
;;;
;;; do we need subtypes for different numbers of arguments
unknown_v_rel := predsort.
ellipsis_v_rel := predsort.
; For fragments (DPF FCB 2005-08-22) expect to appear in the Matrix any moment now
arg-ev-relation := event-relation &
[ ARG semarg ].
unknown-v-relation := arg-ev-relation &
[ PRED unknown_v_rel ].
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; LMC (2020.04.14)
; Following what the ERG does for selected adverbs and prepositions, we are
; trying to get separable verbs to behave like a verb that is selected/selects
; a specific noun. If we follow the ERG, these verbs should introduce the
; relations (the product of event + noun), and the noun should not introduce
; any relation.
;
;
; The ERG is doing something like:
;
;
; rely_on_v1 := v_pp_e_le &
; [ ORTH < "rely" >,
; SYNSEM [ LKEYS [ --COMPKEY on_p_upon-sel_rel,
; KEYREL.PRED "_rely_v_on_rel" ],
; PHON.ONSET con ] ].
;
; on_prtcl := p_np_ptcl_le &
; [ ORTH < "on" >,
; SYNSEM [ LKEYS.KEYREL.PRED _on_p_sel_rel,
; PHON.ONSET voc ] ].
;
; p_np_ptcl_le := norm_p_prtcl_lexent
; """
; Prep, np, sem empty
; <ex>B relies on C.
; """
; .
;
; norm_p_prtcl_lexent := p_prtcl_lexent &
; [ SYNSEM.LOCAL [ CAT.VAL.COMPS < [ LOCAL.CAT.VAL [ SPR *olist*,
; SPEC *anti_list* ] ] >,
; CONT [ RELS <! !>,
; HCONS <! !> ] ] ].
;
;
; ;;; Rely on's ORTH is activated when it sees 'rely'
; ;;; But it introduces the predicate of "_rely_v_on_rel" (note starting underscore)
; ;;; 'Rely on' uses --COMPKEY to select "on_p_upon-sel_rel"
; ;;;
; ;;;
; ;;;
; ;;;
;
;
; selected_rel := event_rel.
; selected_prep_rel := selected_rel & prep_rel.
;
; on_p_sel_rel := selected_prep_rel.
; on_p_upon-sel_rel := selected_prep_rel.
; _on_p_sel_rel := on_p_sel_rel & on_p_upon-sel_rel.
;
;
; ;;;
; ;;;
; ;;;
; ;;;
;
;
; v_pp_e_le := main_verb &
; """
; Cmps PP(sel,obl)
; <ex>B looked after C.
; """
; [ SYNSEM empty_prep_intrans_verb &
; [ LKEYS [ --COMPKEY #cmin,
; --+COMPKEY #cmin ] ] ].
;
; empty_prep_intrans_verb := basic_empty_prep_intrans_verb &
; [ LOCAL.CONT.RELS <! relation !> ].
;
; basic_empty_prep_intrans_verb := twoarg_verb_synsem & prep_intrans_subst &
; empty_prep_intrans_lt &
; [ LOCAL [ CAT.VAL.COMPS < [ OPT - ] >,
; CONT.RELS.LIST.FIRST #keyrel ],
; LKEYS.KEYREL #keyrel ].
;
;
;
;
;
; However,
; selected-noun-rel := selected-rel & noun-relation.
; doesn't work because the ARG0 for event-relation is 'event' and for
; noun-relation is 'ref-ind'.
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
selected_rel := predsort
"""
selected_rel is a sister of norm_rel, and hence both types are not compatible.
selected_rel is used to define semantically empty predicates (LKEYS.KEYREL.PRED selected_rel),
and is being used to allow some lexical entries (e.g. verbs) to require this type of relations in
their argument structure.
""".
norm_rel := predsort
"""
""".
selected_comp_rel := selected_rel
"""
""".
n_nosem_selected := selected-lex & no-rels-hcons-icons-lex-item &
"""
This type is for nominal complements of separable verbs (verbs that have non-compositional semantics with special complements). These are selected by the verb, introduce no semantics on their own, but can be separated from the verb by things like aspect markers and certain modifiers.
Added [BOUND +] from blocking them from being pumped through other rules that require SORT (e.g. time and place adp). Since these don't introduce any semantics they can't have a value for SORT.
Added [LOC -] to block this from being pumped into locative adpositions.
Added [MODIFIABLE -] for now (but this should revisited later).
Added [NONSUBJ +] to block separable complements from ever becoming subjects.
[FIXME] Given the syntactic nature of the bound complements, and the way they interact with a range of modifiers between the verb and bound complement, we expect the bound complements to preserve all its syntactic features (e.g. countability, noun types, etc.) this is not being done yet.
**********
[FIXED] A previous version of this type was breaking things during treebank. It could not be selected, although it will generate a nice parse if the corresponding v_np_sep_le was chosen instead (that verb selects the available n_nosem_selected as its complement).
The reason for this was that the lexical entries were specifying inanimate in their PNG, and this was forcing the nouns to actually behave as having a referential index when in fact we are stating that they have no semantincs. It is not clear to me why the grammar was compiling. but after removing this the FFTB is happy.
**********
"""
[ ARG-ST < >,
SYNSEM [ PAREN -,
BOUND +,
PUNCTUATED -,
LOCAL [CAT [HEAD noun & [ LOC -,
MODIFIABLE - ],
NONSUBJ +,
VAL [ COMPS < >,
SUBJ < >,
SPR < > ] ],
CONT [ RELS <! !>,
HCONS <! !> ] ] ] ].
v_np_sep_le := transitive-sep-lex-item & nonque-item &
verb-no-spr-item & main-verb-lex & aspect-rule-dtr &
"""
transitive-super-lex-item = takes an argument but has no ARG2 in the semantics.
Added [OPT -] to SYNSEM.LOCAL.CAT.VAL.COMPS to guarantee that this is bound complement is always there. This should ensure that it doesn't get discharged by optional complement rules.
"""
[ SYNSEM [ LOCAL [ CAT.VAL.COMPS < #comp &
[ OPT -,
LOCAL.CAT.HEAD.KEYS.KEY #key] >,
CONT.HOOK.INDEX #compindex ],
LKEYS [KEYREL.ARG1 #subj,
--COMPKEY #key] ],
ARG-ST < [ LOCAL [ CAT.HEAD noun,
CONT.HOOK.INDEX #subj ] ],
#comp &
[ LOCAL [ CAT [ VAL [ SPR < >,
COMPS < > ],
HEAD noun ],
CONT.HOOK.INDEX #compindex ] ] > ].
cl_x_rel := norm_rel
"""
Having cl_x_rel under norm_rel makes the claim that all selected_rel (non-norm_rel) cannot be classified over. This might not be the case. We could use ALTKEY instead of KEY if we want to allow CLs to happen in selected rels.
""".
intensifier_x_rel := predsort.
redup_x_rel := intensifier_x_rel.
neg_x_rel := predsort.
nm_rel := predsort.
measure_x_rel := predsort.
bridge_x_rel := predsort.
;;for nouns being used as PP modifying verbs
place_p_rel := predsort.
time_p_rel := predsort.
addressee_p_rel := predsort.
fragment_head := head.
;;; (DPF and FCB 2009-02) Allow saturated valences to include zero pronouns
;;; maybe SPR is also olist?
saturated := valence &
[SUBJ olist,
COMPS olist,
SPR null].
super-saturated := saturated &
[SUBJ null,
COMPS null,
SPR null].
+vj :+
[ STATIVE luk,
PRED-KEY predsort ].
char := avm &
[ FCHAR string,
WCHAR string,
LENGTH length ].
length := avm.
one-or-two := length.
more-than-one := length.
one := one-or-two.
two := one-or-two & more-than-one.
more-than-two := more-than-one.
;; WWJ 2015-04-07: EXISTV for 有; MODIFIABLE used
;; for A-elements in A-not-A structures
;; ZZF & FB 2016-10-3: EMPTY for phrases created by rule with an empty head
head :+
[ EMPTY bool,
CHAR char,
EXISTV bool,
MODIFIABLE bool,
LOC luk,
MEASURE luk ].
lex-item :+
[ STEM.FIRST #str,
SYNSEM.LOCAL.CAT.HEAD.CHAR.WCHAR #str ].
marker-or-punct := head &
[ MOD <> ].
marker := marker-or-punct.
punct := marker-or-punct.
;============================================================================
; Below we define PFORM (preposition form) as a feature, and then introduces
; a mini hierarchy of prepositions that can be selected by verbs.
; prepositions can say define it's PFORM like so:
; SYNSEM.LOCAL.CAT.HEAD.PFORM zai
; which can be selected by verbs's argument structure like so:
; [ ARG-ST < [], [], [ LOCAL.CAT [ HEAD [ PFORM zai ] ] ] > ].
;============================================================================
+np :+ [ PFORM pform ].
pform := avm.
gei-or-xiang := pform.
gei := gei-or-xiang.
xiang := gei-or-xiang.
zai := pform.
you := pform.
dui := pform.
voc := pform.
+njd :+
[ HON luk,
GENERIC luk,
CLASSIFIED luk ].
;; SSH 2014-10-10 nominalizer 的 'de'
nm := noun.
num :+
[ CARDINAL bool ].
;; SSH 2015-04-16: The following are revised.
prep := adp.
postp := adp.
postp-assoc := postp.
postp-assoc-n := postp-assoc & postp-nominalizable.
postp-assoc-v := postp-assoc.
postp-nominalizable := postp.
postp-comp := postp-nominalizable.
;; SSH 2014-09-02: Gender is necessary to distinguish he and she.
;; 她 追赶 了 他: She chased him.
;; In addition, Animacy is also neceesary to disinguish s(he) and it.
;; 她 追赶 了 它: She chasd it.
png :+
[ PERNUM pernum,
GENDER gender,
ANIMACY animacy ].
;;; Pernum
pernum := *top*.
sg := pernum.
indet := pernum.
pl := pernum.
1st := pernum.
2nd := pernum.
3rd := pernum.
1sg := 1st & sg.
2sg := 2nd & sg.
3sg := 3rd & sg.
1indet := 1st & indet.
2indet := 2nd & indet.
3indet := 3rd & indet.
1pl := 1st & pl.
1pl_incl := 1pl.
1pl_excl := 1pl.
2pl := 2nd & pl.
3pl := 3rd & pl.
;;; SSH 2014-09-02
;;; Gender
gender := *top*.
masc := gender.
fem := gender.
;;; SSH 2014-09-02; 2015-04-08 revised
;;; Animacy
animacy := *top*.
animate := animacy.
human := animate.
non-human := animate.
inanimate := animacy.
;;; Form
form := *top*.
nonfinite := form.
finite := form.
;============================================================================
; ASPECT
;============================================================================
;; SSH 2014-09-19: The type hierarchy for aspect should be researched
;; more. We assume here that no-marking implies *imperfective*.
;; 2016-2-15 ZZF changing experiential (guo) from "imperfective" to "perfective" ::fix me
;============================================================================
; ORIGINAL:
;============================================================================
;
; aspect:
; > perf-or-exp:
; >> perfective------------------------
; >> experiential |
; > durative |-- tent-and-perf
; > delimitative |
; > tentative -------------------------------------
; > imperfective
;
;
;============================================================================
; FACTS:
; Some aspect particles (LE, GUO) are being dealt with through the
; 'comp-marker' rule. Even though there is a 'marker-comp' rule, this is not
; being used to deal with pre-verbal aspect. 'comp-marker' and 'marker-comp'
; rules are also being used to deal with certain symbols like parenthesis,
; quotes, etc.
;
; Pre-verbal aspect markers (e.g. 在 and 正在) are actually being handled by the
; 'mod-head-int' rule.
;
; verbs (and adjectives) HEAD.LZG le+zhe+guo
; in cmn.tdl there is the hierarchy for 'le+zhe+guo'
;============================================================================
; (regular) MEI need to be blocked by:
; - Adjectives
; - Stative verbs (for now we can assume those are verbs that take HEN+ ZAI + SHI); verbs that can't take MEI also can't take LE;
; - Verbs that have been marked for aspect LE cannot take MEI (i.e. they are siblings in the hierarchy); they also can't take BU;
; - GUO (experiential) is incompatible with LE and other aspectcs;
; - GUO (experiential) cannot take BU but can take MEI; This seems to show that GUO is "a subtype of aspect compatible with MEI under that is unspecified for positive or negative. LE, on the otherhand, is already marked for "positive" and that is why it directly competes with MEI.
; MEI is strictly required by YOU (which cannot take BU)
;<???> Can YOU take LE as aspect? (他有了三只猫) ???
; Some in the literature call MEI imperfective, orther neg-perfective; ZHONG actually has MEI as imperfective commented out... :/
; MEI + LE = NO
; LE + GUO = NO
; MEI + GUO = YES
; perf-exp
; > pos-exp = verb + GUO
; > neg-exp = MEI + verb + GUO
; * BU + verb + GUO
; > pos-perf = verb + LE
; > neg-perf = MEI + verb
; * MEI + verb + LE
; * BU + verb + LE
; non-perf-or-exp ----- BU (once it takes BU it cannot take LE or GUO)
; perf-exp:
; ---- neg-perf selected by MEI (blocks LE, but not GUO)
; ---- neg-perf-or-exp: MEI requires this
; ---- pos-perf-or-exp: (blocks MEI) allows LE or GUO
; perfective: LE(positive) MEI(negative) experiential
; - GUO
; - MEI + GUO
; GUO: experiential
; MEI: negative-PERF-OR-EXPERIENTIAL
; LE: positive perfective
; BU: negative-non-perfective
; For adjetives (for now) I want 'no-aspect'
;============================================================================
perfective := aspect.
tentative := aspect.
imp-exp-or-dur := aspect
"""
This is the aspect value 没 restricts to.
When it appears by itself, it is usually considered simply 'imperfective'. However, 没 is also used to negate 过, 着 and 在. This means that 'imperfective', 'experiential' and 'durative' need to inherit from a single parent.
When paired with one of the other aspect particles, they will find the adequate GLB.
[FIXME] This would be a case where we would want to rewrite this using the vpm. 'imperfective-or-experiential-or-durative' could be set to 'imperfective' by default to avoid overgeneration.
""".
imperfective := imp-exp-or-dur.
experiential := imp-exp-or-dur.
durative := imp-exp-or-dur.
tent-and-perf := tentative & perfective
"""
FZZ 2017-01-10 for '看 了 一下'
""".
non-aspect := imperfective
"""
SSH 2014-09-04; blocking overgeneration.
[FIXME] This is actually being used for both 不 and, A-NOT-A constructions. But it is not clear whether or not it should be inheriting from 'imperfective'.
""".
;============================================================================
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SSH 2015-05-24
;; CTXT (Honorification)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
dialogue := icons.
addressor := dialogue.
addressee := dialogue.
rank := icons.
higher-or-equal := rank.
lower-or-equal := rank.
higher := higher-or-equal.
lower := lower-or-equal.
equal := higher-or-equal & lower-or-equal.
ctxt :+ [ C-INDICES c-indices ].
c-indices := avm &
[ SPEAKER ref-ind,
HEARER ref-ind ].
;;; Phrasal types
head-only :+
[ SYNSEM.LOCAL.CAT [ NONSUBJ #ns,
NONCOMP #nc ],
HEAD-DTR.SYNSEM.LOCAL.CAT [ NONSUBJ #ns,
NONCOMP #nc ] ].
;;ZZF 2016-11-29 removed "BOUND na-or--," from head-dtr, to allow adv suffix (bound) to take comp.
basic-head-comp-phrase :+
[ SYNSEM.LOCAL.CAT [ MC #mc,
NONCOMP #nc,
VAL.SPEC #spec ],
HEAD-DTR.SYNSEM [ LOCAL.CAT [ MC #mc,
NONCOMP #nc,
VAL.SPEC #spec ] ] ].
; SSH 2014-08-25 Zhong specific head-adj-phrase This consraint was in
; the previous version of matrix.tdl, but it was removed by Antske
; Fokkens and Joshua Crowgey (2012-26-09).
head-adj-phrase :+
[ SYNSEM.INTERJECTED #interjected,
HEAD-DTR.SYNSEM [ INTERJECTED #interjected,
MODIFIED notmod-or-rmod ] ].
head-adj-int-phrase :+
"""
Using OPT on non-head-dtr to prevent a special DeP from being taken as a normal modifier.
"""
[ SYNSEM [ L-PERIPH #lperiph,
R-PERIPH #rperiph ],
HEAD-DTR.SYNSEM.R-PERIPH na-or--,
NON-HEAD-DTR.SYNSEM [ L-PERIPH #lperiph,
R-PERIPH #rperiph,
PUNCTUATED na-or--,
LOCAL.CAT.HEAD.MOD < [ OPT na-or-- ] > ] ].
;; WWJ (2015-03-28): NHD's SPART and Phrase's NHD are identified... is this ok?
head-adj-scop-phrase :+
[ SYNSEM.SPART #spart,
HEAD-DTR.SYNSEM.ASPECTED +-or--,
NON-HEAD-DTR.SYNSEM [ BOUND -,
SPART #spart ] ].
head-comp-phrase := basic-head-1st-comp-phrase & head-initial &
"""
It is not clear why this was marked as [PUNCTUATED na-or--] and it was blocking parses like:
<ex> 电邮 地址 是 : [email protected]
(The email address is [email protected])
;; The head of head-comp-phrase can't be: ['comp']
"""
[ SYNSEM phr-synsem,
HEAD-DTR.SYNSEM [ LOCAL.CAT.HEAD +nvjrpdmo,
; PUNCTUATED na-or--,
POSTCOMP na-or-- ],
NON-HEAD-DTR.SYNSEM [ R-PERIPH na-or--,
INTERJECTED na-or--,
CH na-or-- ] ].
;; WWJ (2015-03-28) - HEAD-DTR's spart value is passed up to this phrase
head-comp-phrase :+
[ SYNSEM.SPART #spart,
HEAD-DTR.SYNSEM.SPART #spart ].
; HEAD-DTR.SYNSEM.SPART #spart,
; NON-HEAD-DTR.SYNSEM.BOUND - ].
;; SSH/ZZF 2015-07-15
head-comp-phrase :+
[ SYNSEM.LOCAL.CAT.NONCOMP #nc,
HEAD-DTR.SYNSEM.LOCAL.CAT.NONCOMP #nc ].
;; to allow 0-1-dlist SYNSEM.NON-LOCAL.SLASH 0-dlist ].
head-2nd-comp-phrase := basic-head-2nd-comp-phrase & head-initial &
"""
;; SSH 2015-04-16: adp -> prep
"""
[ SYNSEM phr-synsem &
[ LOCAL.CAT.HEAD verb ],
HEAD-DTR.SYNSEM.POSTCOMP na-or--,
NON-HEAD-DTR.SYNSEM [ LOCAL.CAT.HEAD prep,
R-PERIPH na-or--,
INTERJECTED na-or-- ] ].
;; SSH 2015-04-16: adp -> +np (ex. 我 [教室 里] 哭 了)
comp-head-final-phrase := basic-head-1st-comp-phrase & head-final &
"""
POSTCOMP + == I'm after my comps
LMC: added a BOUND na-or-- constrain to the NON-HEAD-DTR to prevent it
from picking up bound morphemes like 们.
"""
[ SYNSEM.LOCAL.CAT.HEAD +njrpdmo,
HEAD-DTR.SYNSEM.POSTCOMP +,
NON-HEAD-DTR.SYNSEM [ R-PERIPH na-or--,
CH na-or-+,
BOUND na-or--,
LOCAL.CAT.HEAD +nvjrp ] ].
non-local := non-local-min &
"""
;;; Matrix redifinition
;;; redefine QUE to allow >1 wh-words in a sentence
;;; taking out QUE from the basic-one/two/three-arg
;;; QUE value is instead amalgated by unary/binary rules
"""
[ SLASH 0-1-dlist,
QUE diff-list,
REL 0-1-dlist ].
basic-one-arg := lex-item &
"""
;;; Matrix redifinition
;;; redefine QUE to allow >1 wh-words in a sentence
;;; taking out QUE from the basic-one/two/three-arg
;;; QUE value is instead amalgated by unary/binary rules
"""
[ ARG-ST < [ NON-LOCAL [ SLASH #slash,
REL #rel ] ] >,
SYNSEM.NON-LOCAL [ SLASH #slash,
REL #rel ] ].
basic-two-arg := lex-item &
"""
;;; Matrix redifinition
;;; redefine QUE to allow >1 wh-words in a sentence
;;; taking out QUE from the basic-one/two/three-arg
;;; QUE value is instead amalgated by unary/binary rules
"""
[ ARG-ST < [ NON-LOCAL [ SLASH [ LIST #smiddle,
LAST #slast ],
REL [ LIST #rmiddle,
LAST #rlast ] ] ],
[ NON-LOCAL [ SLASH [ LIST #sfirst,
LAST #smiddle ],
REL [ LIST #rfirst,
LAST #rmiddle ] ] ] >,
SYNSEM.NON-LOCAL [ SLASH [ LIST #sfirst,
LAST #slast ],
REL [ LIST #rfirst,
LAST #rlast ] ] ].
basic-three-arg := lex-item &
"""
;;; Matrix redifinition
;;; redefine QUE to allow >1 wh-words in a sentence
;;; taking out QUE from the basic-one/two/three-arg
;;; QUE value is instead amalgated by unary/binary rules
"""
[ ARG-ST < [ NON-LOCAL [ SLASH [ LIST #smiddle2,
LAST #slast ],
REL [ LIST #rmiddle2,
LAST #rlast ] ] ],
[ NON-LOCAL [ SLASH [ LIST #sfirst,
LAST #smiddle1 ],
REL [ LIST #rfirst,
LAST #rmiddle1 ] ] ],
[ NON-LOCAL [ SLASH [ LIST #smiddle1,
LAST #smiddle2 ],
REL [ LIST #rmiddle1,
LAST #rmiddle2 ] ] ] >,
SYNSEM.NON-LOCAL [ SLASH [ LIST #sfirst,
LAST #slast ],
REL [ LIST #rfirst,
LAST #rlast ] ] ].
unary-phrase-super := basic-unary-phrase &
[ INFLECTED infl-satisfied,
ARGS < [ INFLECTED infl-satisfied ] > ].
unary-phrase := unary-phrase-super &
"""
This was redefined from Matrix. The info that existed in 'matrix.tdl' is now in 'unary-phrase-super'.
"""
[ SYNSEM.NON-LOCAL.QUE #que,
ARGS < sign & [ SYNSEM.NON-LOCAL.QUE #que ] > ].
unary-phrase :+
"""
"""
[ SYNSEM.LOCAL.CONT.HOOK [ SPEAKER-KEY #skey,
HEARER-KEY #hkey ],
ARGS < [ SYNSEM.LOCAL.CONT.HOOK [ SPEAKER-KEY #skey,
HEARER-KEY #hkey ] ] > ].
basic-binary-phrase :+
[ SYNSEM [ PUNCTUATED #punc,
NON-LOCAL.QUE [ LIST #first,
LAST #last ] ],
ARGS < sign & [ SYNSEM.NON-LOCAL.QUE [ LIST #first,
LAST #middle ] ],
sign & [ SYNSEM [ PUNCTUATED #punc,
NON-LOCAL.QUE [ LIST #middle,
LAST #last ] ] ] > ].
head-nexus-phrase := head-nexus-rel-phrase
"""
This is a redefinition from the Matrix.
;;removed head-nexus-que-phrase as QUE is now collected differently.
""".
; basic-head-subj-phrase := head-valence-phrase & head-compositional &
; basic-binary-headed-phrase &
; """
; ;;; Matrix redifinition
; ;;; remove "QUE 0-dlist" from NON-HEAD-DTR
; ;;; as subj can be or contain wh-word
; ;;; e.g. "谁" "哪 个 人" "谁 的 书" etc.
; """
; [ SYNSEM phr-synsem &
; [ LOCAL.CAT [ POSTHEAD +,
; HC-LIGHT -,
; VAL [ SUBJ < >,
; COMPS #comps,
; SPR #spr ] ] ],
; HEAD-DTR.SYNSEM.LOCAL.CAT.VAL [ SUBJ < #synsem >,
; COMPS #comps,
; SPR #spr ],
; NON-HEAD-DTR.SYNSEM #synsem & canonical-synsem &
; [ LOCAL [ CAT [ VAL [ SUBJ olist,
; COMPS olist,
; SPR olist ] ] ],
; NON-LOCAL [ SLASH 0-dlist & [ LIST < > ],
; REL 0-dlist ] ],
; C-CONT [ RELS <! !>, HCONS <! !>, ICONS <! !> ] ].