Commit 4f334c36b7fc9b90cc27426902f735accbefe61e
1 parent
038956d1
po poprawkach parsowania drzew
Showing
4 changed files
with
99 additions
and
14 deletions
LCGlexicon/ENIAM_LCGlexicon.ml
... | ... | @@ -247,41 +247,41 @@ let make_term id orth rules = |
247 | 247 | Xlist.map rules (fun (cats,syntax,(semantics,weight)) -> |
248 | 248 | ENIAM_LCGrenderer.reset_variable_names (); |
249 | 249 | ENIAM_LCGrenderer.add_variable_numbers (); |
250 | - print_endline ("make_term 0: " ^ ENIAM_LCGstringOf.grammar_symbol 0 syntax); | |
250 | + (* print_endline ("make_term 0: " ^ ENIAM_LCGstringOf.grammar_symbol 0 syntax); *) | |
251 | 251 | match semantics with |
252 | 252 | BasicSem cat_list -> |
253 | 253 | let node = make_node id orth cats.lemma cats.pos syntax weight(*+.token.ENIAMtokenizerTypes.weight*) cat_list false in |
254 | - print_endline ("make_term 1: " ^ ENIAM_LCGstringOf.grammar_symbol 0 syntax); | |
254 | + (* print_endline ("make_term 1: " ^ ENIAM_LCGstringOf.grammar_symbol 0 syntax); *) | |
255 | 255 | let semantics = ENIAM_LCGrenderer.make_term node syntax in |
256 | 256 | ENIAM_LCGrenderer.simplify (syntax,semantics) |
257 | 257 | | RaisedSem(cat_list,outer_cat_list) -> |
258 | 258 | (* FIXME: jakie atrybuty powinien mieć outer node (w szczególności jaką wagę?) *) |
259 | 259 | let node = make_node id orth cats.lemma cats.pos syntax weight(*+.token.ENIAMtokenizerTypes.weight*) cat_list true in |
260 | 260 | let outer_node = make_node id orth cats.lemma cats.pos syntax weight(*+.token.ENIAMtokenizerTypes.weight*) outer_cat_list false in |
261 | - print_endline ("make_term 2: " ^ ENIAM_LCGstringOf.grammar_symbol 0 syntax); | |
261 | + (* print_endline ("make_term 2: " ^ ENIAM_LCGstringOf.grammar_symbol 0 syntax); *) | |
262 | 262 | let semantics = ENIAM_LCGrenderer.make_raised_term node outer_node syntax in |
263 | 263 | ENIAM_LCGrenderer.simplify (syntax,semantics) |
264 | 264 | | TermSem(cat_list,"λxλyλz.NODE(yx,z)") -> |
265 | 265 | let node = make_node id orth cats.lemma cats.pos syntax weight(*+.token.ENIAMtokenizerTypes.weight*) cat_list false in |
266 | - print_endline ("make_term 3: " ^ ENIAM_LCGstringOf.grammar_symbol 0 syntax); | |
266 | + (* print_endline ("make_term 3: " ^ ENIAM_LCGstringOf.grammar_symbol 0 syntax); *) | |
267 | 267 | let semantics = or_frame node in |
268 | 268 | ENIAM_LCGrenderer.simplify (syntax,semantics) |
269 | 269 | | _ -> failwith "make_term: ni") |
270 | 270 | |
271 | 271 | let create_entries rules id orth cats valence = |
272 | 272 | Xlist.fold cats [] (fun l cats -> |
273 | - Printf.printf "create_entries: orth=%s lemma=%s pos=%s\n" orth cats.lemma cats.pos; | |
273 | + (* Printf.printf "create_entries: orth=%s lemma=%s pos=%s\n" orth cats.lemma cats.pos; *) | |
274 | 274 | (* variable_name_ref := []; *) |
275 | 275 | if cats.pos="interp" && cats.lemma="<clause>" then (BracketSet(Forward),Dot) :: l else |
276 | 276 | if cats.pos="interp" && cats.lemma="</clause>" then (BracketSet(Backward),Dot) :: l else |
277 | 277 | let e = get_labels () in |
278 | - print_endline "create_entries 1"; | |
278 | + (* print_endline "create_entries 1"; *) | |
279 | 279 | let rules = find_rules rules cats in |
280 | - Printf.printf "create_entries 2: %s %s |rules|=%d\n" cats.lemma cats.pos (Xlist.size rules); | |
280 | + (* Printf.printf "create_entries 2: %s %s |rules|=%d\n" cats.lemma cats.pos (Xlist.size rules); *) | |
281 | 281 | let rules = assign_valence valence rules in |
282 | - print_endline "create_entries 3"; | |
282 | + (* print_endline "create_entries 3"; *) | |
283 | 283 | let rules = make_quantification e rules in |
284 | - print_endline "create_entries 4"; | |
284 | + (* print_endline "create_entries 4"; *) | |
285 | 285 | let rules = make_term id orth rules in |
286 | - print_endline "create_entries 5"; | |
286 | + (* print_endline "create_entries 5"; *) | |
287 | 287 | rules @ l) |
... | ... |
LCGparser/TODO
corpora/test_conll.ml
... | ... | @@ -73,11 +73,11 @@ let rec dep_create_rec nodes sons conll_id = |
73 | 73 | DepNode(conll_id, Xlist.map left (dep_create_rec nodes sons), node, Xlist.map right (dep_create_rec nodes sons)) |
74 | 74 | |
75 | 75 | let create_dep_chart tokens lex_sems paths = |
76 | - print_endline "create_dep_chart 1"; | |
76 | + (* print_endline "create_dep_chart 1"; *) | |
77 | 77 | let sons = Int.fold 1 (Array.length paths - 1) IntMap.empty (fun sons i -> |
78 | 78 | let _,super,_ = paths.(i) in |
79 | 79 | IntMap.add_inc sons super [i] (fun l -> i :: l)) in |
80 | - print_endline "create_dep_chart 2"; | |
80 | + (* print_endline "create_dep_chart 2"; *) | |
81 | 81 | let nodes = Int.fold 0 (Array.length paths - 1) IntMap.empty (fun nodes i -> |
82 | 82 | let id,_,_ = paths.(i) in |
83 | 83 | let t = ExtArray.get tokens id in |
... | ... | @@ -87,9 +87,9 @@ let create_dep_chart tokens lex_sems paths = |
87 | 87 | let cats = clarify_categories ["X"] t in |
88 | 88 | let l = ENIAM_LCGlexicon.create_entries dep_rules id t.ENIAMtokenizerTypes.orth cats s.ENIAMlexSemanticsTypes.schemata in |
89 | 89 | IntMap.add nodes i l) in |
90 | - print_endline "create_dep_chart 3"; | |
90 | + (* print_endline "create_dep_chart 3"; *) | |
91 | 91 | let x = dep_create_rec nodes sons 0 in |
92 | - print_endline "create_dep_chart 4"; | |
92 | + (* print_endline "create_dep_chart 4"; *) | |
93 | 93 | x |
94 | 94 | |
95 | 95 | |
... | ... | @@ -124,7 +124,9 @@ let test_example path id tokens lex_sems paths last = |
124 | 124 | let test_dep_example path id tokens lex_sems paths = |
125 | 125 | try |
126 | 126 | ENIAM_LCGreductions.reset_variant_label (); |
127 | + print_endline "test_dep_example 1"; | |
127 | 128 | let paths = CONLL_adapter.convert_dep_tree id (*first_try*) true paths tokens in |
129 | + print_endline "test_dep_example 2"; | |
128 | 130 | (* ENIAMsubsyntaxHTMLof.print_dep_sentence path (id^"1_paths") tokens paths; *) |
129 | 131 | let chart = create_dep_chart tokens lex_sems paths in |
130 | 132 | (* ENIAM_LCGlatexOf.print_dep_chart path (id^"1_chart") "a1" chart; *) |
... | ... |
testy/skladnica-test1-Failure.conll
1 | +1 - - interp interp _ 3 punct _ _ | |
2 | +2 Panowie pan subst subst pl|nom|m1 3 subj _ _ | |
3 | +3 przyszli przyjść praet praet pl|m1|perf 0 pred _ _ | |
4 | +4 . . interp interp _ 3 punct _ _ | |
5 | + | |
1 | 6 | 1 O o prep prep loc 12 comp _ _ |
2 | 7 | 2 klasztornym klasztorny adj adj sg|loc|n|pos 3 adjunct _ _ |
3 | 8 | 3 piekle piekło subst subst sg|loc|n 1 comp _ _ |
... | ... | @@ -16,8 +21,84 @@ |
16 | 21 | 16 br bieżący_rok brev brev pun 15 ne _ _ |
17 | 22 | 17 . . interp interp _ 12 punct _ _ |
18 | 23 | |
24 | +1 Następnie następnie adv adv _ 2 adjunct _ _ | |
25 | +2 rozłożyła rozłożyć praet praet sg|f|perf 10 conjunct _ _ | |
26 | +3 wysoki wysoki adj adj sg|acc|m3|pos 4 adjunct _ _ | |
27 | +4 statyw statyw subst subst sg|acc|m3 2 obj _ _ | |
28 | +5 , , interp interp _ 10 coord_punct _ _ | |
29 | +6 zawiesiła zawiesić praet praet sg|f|perf 10 conjunct _ _ | |
30 | +7 na na prep prep loc 6 adjunct _ _ | |
31 | +8 nim on ppron3 ppron3 sg|loc|m3|ter|akc|praep 7 comp _ _ | |
32 | +9 pudełko pudełko subst subst sg|acc|n 6 obj _ _ | |
33 | +10 , , interp interp _ 0 pred _ _ | |
34 | +11 przeprowadziła przeprowadzić praet praet sg|f|perf 10 conjunct _ _ | |
35 | +12 od od prep prep gen|nwok 11 adjunct _ _ | |
36 | +13 niego on ppron3 ppron3 sg|gen|n|ter|akc|praep 12 comp _ _ | |
37 | +14 przezroczysty przezroczysty adj adj sg|acc|m3|pos 15 adjunct _ _ | |
38 | +15 przewód przewód subst subst sg|acc|m3 11 obj _ _ | |
39 | +16 do do prep prep gen 11 adjunct _ _ | |
40 | +17 igły igła subst subst sg|gen|f 16 comp _ _ | |
41 | +18 , , interp interp _ 23 punct _ _ | |
42 | +19 którą który adj adj sg|acc|f|pos 23 obj _ _ | |
43 | +20 wcześniej wcześnie adv adv com 23 adjunct _ _ | |
44 | +21 automatyczny automatyczny adj adj sg|nom|m3|pos 22 adjunct _ _ | |
45 | +22 iniektor iniektor subst subst sg|nom|m3 23 subj _ _ | |
46 | +23 umieścił umieścić praet praet sg|m3|perf 17 adjunct _ _ | |
47 | +24 w w prep prep loc|nwok 23 comp _ _ | |
48 | +25 żyle żyła subst subst sg|loc|f 24 comp _ _ | |
49 | +26 na na prep prep loc 25 adjunct _ _ | |
50 | +27 przedramieniu przedramię subst subst sg|loc|n 26 comp _ _ | |
51 | +28 Irka Irek subst subst sg|gen|m1 27 adjunct _ _ | |
52 | +29 . . interp interp _ 10 punct _ _ | |
53 | + | |
19 | 54 | 1 - - interp interp _ 4 punct _ _ |
20 | 55 | 2 Co co subst subst sg|nom|n 4 pd _ _ |
21 | 56 | 3 to to subst subst sg|nom|n 4 subj _ _ |
22 | 57 | 4 jest być fin fin sg|ter|imperf 0 pred _ _ |
23 | 58 | 5 ? ? interp interp _ 4 punct _ _ |
59 | + | |
60 | +1 Prosi prosić fin fin sg|ter|imperf 0 pred _ _ | |
61 | +2 się się qub qub _ 1 refl _ _ | |
62 | +3 też też qub qub _ 1 adjunct _ _ | |
63 | +4 zakłady zakład subst subst pl|acc|m3 1 obj _ _ | |
64 | +5 pracy praca subst subst sg|gen|f 4 adjunct _ _ | |
65 | +6 , , interp interp _ 8 punct _ _ | |
66 | +7 które który adj adj pl|nom|m3|pos 8 subj _ _ | |
67 | +8 dysponują dysponować fin fin pl|ter|imperf 4 adjunct _ _ | |
68 | +9 autobusami autobus subst subst pl|inst|m3 8 comp _ _ | |
69 | +10 , , interp interp _ 12 punct _ _ | |
70 | +11 by by comp comp _ 12 complm _ _ | |
71 | +12 wspomogły wspomóc praet praet pl|m3|perf 1 comp_fin _ _ | |
72 | +13 komunikację komunikacja subst subst sg|acc|f 12 obj _ _ | |
73 | +14 zastępczą zastępczy adj adj sg|acc|f|pos 13 adjunct _ _ | |
74 | +15 . . interp interp _ 1 punct _ _ | |
75 | + | |
76 | +1 - - interp interp _ 3 punct _ _ | |
77 | +2 Nie nie qub qub _ 3 neg _ _ | |
78 | +3 chcą chcieć fin fin pl|ter|imperf 0 pred _ _ | |
79 | +4 , , interp interp _ 8 punct _ _ | |
80 | +5 by by comp comp _ 8 complm _ _ | |
81 | +6 m być aglt aglt sg|pri|imperf|nwok 8 aglt _ _ | |
82 | +7 ich on ppron3 ppron3 pl|acc|m1|ter|akc|npraep 8 obj _ _ | |
83 | +8 utrzymywał utrzymywać praet praet sg|m1|imperf 3 comp_fin _ _ | |
84 | +9 . . interp interp _ 3 punct _ _ | |
85 | + | |
86 | +1 Wzięli wziąć praet praet pl|m1|perf 0 pred _ _ | |
87 | +2 w w prep prep loc|nwok 4 adjunct _ _ | |
88 | +3 niej on ppron3 ppron3 sg|loc|f|ter|akc|praep 2 comp _ _ | |
89 | +4 udział udział subst subst sg|acc|m3 1 obj _ _ | |
90 | +5 przedstawiciele przedstawiciel subst subst pl|nom|m1 1 subj _ _ | |
91 | +6 policji policja subst subst sg|gen|f 5 adjunct _ _ | |
92 | +7 z z prep prep gen|nwok 5 adjunct _ _ | |
93 | +8 Niemiec Niemcy subst subst pl|gen|n 17 conjunct _ _ | |
94 | +9 , , interp interp _ 17 coord_punct _ _ | |
95 | +10 Czech Czechy subst subst pl|gen|n 17 conjunct _ _ | |
96 | +11 , , interp interp _ 17 coord_punct _ _ | |
97 | +12 Słowacji Słowacja subst subst sg|gen|f 17 conjunct _ _ | |
98 | +13 , , interp interp _ 17 coord_punct _ _ | |
99 | +14 Węgier Węgry subst subst pl|gen|n 17 conjunct _ _ | |
100 | +15 , , interp interp _ 17 coord_punct _ _ | |
101 | +16 Ukrainy Ukraina subst subst sg|gen|f 17 conjunct _ _ | |
102 | +17 i i conj conj _ 7 comp _ _ | |
103 | +18 Polski Polska subst subst sg|gen|f 17 conjunct _ _ | |
104 | +19 . . interp interp _ 1 punct _ _ | |
... | ... |