Commit 7ee5de12 authored by bguillaum's avatar bguillaum
Browse files

pos is optional in CONLL input (value "_")

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/semagramme/libcaml-grew/trunk@7796 7838e531-6607-4d57-9587-6c381814729c
parent 548db436
...@@ -166,13 +166,15 @@ module G_fs = struct ...@@ -166,13 +166,15 @@ module G_fs = struct
List.sort G_feature.compare unsorted List.sort G_feature.compare unsorted
let of_conll line = let of_conll line =
let unsorted = let unsorted_without_pos =
("phon", Domain.build_one "phon" line.Conll.phon) ("phon", Domain.build_one "phon" line.Conll.phon)
:: ("lemma", Domain.build_one "lemma" line.Conll.lemma) :: ("lemma", Domain.build_one "lemma" line.Conll.lemma)
:: ("cat", Domain.build_one "cat" line.Conll.pos1) :: ("cat", Domain.build_one "cat" line.Conll.pos1)
:: ("pos", Domain.build_one "pos" line.Conll.pos2)
:: ("position", Domain.build_one "position" (string_of_int line.Conll.num)) :: ("position", Domain.build_one "position" (string_of_int line.Conll.num))
:: (List.map (fun (f,v) -> (f, Domain.build_one f v)) line.Conll.morph) in :: (List.map (fun (f,v) -> (f, Domain.build_one f v)) line.Conll.morph) in
let unsorted = match line.Conll.pos2 with
| "_" -> unsorted_without_pos
| s -> ("pos", Domain.build_one "pos" s) :: unsorted_without_pos in
List.sort G_feature.compare unsorted List.sort G_feature.compare unsorted
exception Fail_unif exception Fail_unif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment