Skip to content

Commit

Permalink
tests updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Heinecke committed Apr 22, 2024
1 parent 488f077 commit 484c772
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/orange/labs/conllparser/ConllSentence.java
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,8 @@ public String toString(boolean strict) {
if (getText() != null) {
sb.append("# text = ").append(getText().replaceAll("\n", " ").trim()).append('\n');
} else {
sb.append("# text = ").append(getSentence().replaceAll("\n", " ").trim()).append('\n');
// do not adde "# text = ..." if absent in file and not added by user
//sb.append("# text = ").append(getSentence().replaceAll("\n", " ").trim()).append('\n');
}

if (translit != null && !translit.isEmpty()) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/TestConllSentence.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void test01readSDparse() throws IOException, ConllException {

SDParse sdp = new SDParse("the little sleeps mouse\nnsubj(sleeps, mouse)\ndet(mouse, the)\namod(mouse, little)");

String ref = "# text = the little sleeps mouse\n"+
String ref = //"# text = the little sleeps mouse\n"+
"1 the _ _ _ _ 4 det _ _\n"+
"2 little _ _ _ _ 4 amod _ _\n"+
"3 sleeps _ _ _ _ 0 root _ _\n"+
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/createsubtree10cols.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sentenceid": 0,
"maxsentence": 19,
"ok": "# global.columns \u003d ID FORM LEMMA UPOS XPOS FEATS HEAD DEPREL DEPS MISC\n# text \u003d sur la vie de Howard Hughes\n1\tsur\tsur\tADP\t_\t_\t3\tcase\t_\t_\n2\tla\tle\tDET\t_\tDefinite\u003dDef|Gender\u003dFem|Number\u003dSing|PronType\u003dArt\t3\tdet\t_\t_\n3\tvie\tvie\tNOUN\t_\tGender\u003dFem|Number\u003dSing\t0\troot\t_\t_\n4\tde\tde\tADP\t_\t_\t5\tcase\t_\t_\n5\tHoward\tHoward\tPROPN\t_\t_\t3\tnmod\t_\t_\n6\tHughes\tHughes\tPROPN\t_\t_\t5\tflat:name\t_\tSpaceAfter\u003dNo\n\n",
"ok": "# global.columns \u003d ID FORM LEMMA UPOS XPOS FEATS HEAD DEPREL DEPS MISC\n1\tsur\tsur\tADP\t_\t_\t3\tcase\t_\t_\n2\tla\tle\tDET\t_\tDefinite\u003dDef|Gender\u003dFem|Number\u003dSing|PronType\u003dArt\t3\tdet\t_\t_\n3\tvie\tvie\tNOUN\t_\tGender\u003dFem|Number\u003dSing\t0\troot\t_\t_\n4\tde\tde\tADP\t_\t_\t5\tcase\t_\t_\n5\tHoward\tHoward\tPROPN\t_\t_\t3\tnmod\t_\t_\n6\tHughes\tHughes\tPROPN\t_\t_\t5\tflat:name\t_\tSpaceAfter\u003dNo\n\n",
"changes": 0
}
2 changes: 1 addition & 1 deletion src/test/resources/createsubtree5cols.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sentenceid": 1,
"maxsentence": 19,
"ok": "# global.columns \u003d ID LEMMA UPOS HEAD DEPREL\n# text \u003d mais leur contenu diffère donc selon les Facultés\n1\tmais\tCCONJ\t4\tcc\n2\tson\tDET\t3\tnmod:poss\n3\tcontenu\tNOUN\t4\tnsubj\n4\tdifférer\tVERB\t0\troot\n5\tdonc\tADV\t4\tadvmod\n6\tselon\tADP\t8\tcase\n7\tle\tDET\t8\tdet\n8\tFacultés\tPROPN\t4\tobl\n\n",
"ok": "# global.columns \u003d ID LEMMA UPOS HEAD DEPREL\n1\tmais\tCCONJ\t4\tcc\n2\tson\tDET\t3\tnmod:poss\n3\tcontenu\tNOUN\t4\tnsubj\n4\tdifférer\tVERB\t0\troot\n5\tdonc\tADV\t4\tadvmod\n6\tselon\tADP\t8\tcase\n7\tle\tDET\t8\tdet\n8\tFacultés\tPROPN\t4\tobl\n\n",
"changes": 0
}
1 change: 0 additions & 1 deletion src/test/resources/sdparse2.conllu
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# text = I can can the can .
1 I _ _ _ _ 3 nsubj _ _
2 can _ _ _ _ 3 aux _ _
3 can _ _ _ _ 0 root _ _
Expand Down
1 change: 0 additions & 1 deletion src/test/resources/sdparse3.conllu
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# text = POS tags can be attached to ( any part of ) the sentence text .
1 POS _ NNP _ _ 2 dep _ _
2 tags _ NNS _ _ 5 nsubjpass _ _
3 can _ MD _ _ 5 aux _ _
Expand Down

0 comments on commit 484c772

Please sign in to comment.