Skip to content

Commit 2bd034e

Browse files
sebschuStanford NLP
authored and
Stanford NLP
committed
Fix LexicalizedParserITest for UD
1 parent c82c983 commit 2bd034e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

itest/src/edu/stanford/nlp/parser/lexparser/LexicalizedParserITest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ public void testParseString() {
163163
compareOutput(results, false,
164164
"My/PRP$ dog/NN likes/VBZ to/TO eat/VB yoghurt/NN ./.",
165165
"(ROOT (S (NP (PRP$ My) (NN dog)) (VP (VBZ likes) (S (VP (TO to) (VP (VB eat) (NP (NN yoghurt)))))) (. .)))",
166-
"poss(dog-2, My-1) nsubj(likes-3, dog-2) root(ROOT-0, likes-3) aux(eat-5, to-4) xcomp(likes-3, eat-5) dobj(eat-5, yoghurt-6)",
167-
"poss(dog-2, My-1) nsubj(likes-3, dog-2) nsubj(eat-5, dog-2) root(ROOT-0, likes-3) aux(eat-5, to-4) xcomp(likes-3, eat-5) dobj(eat-5, yoghurt-6)");
166+
"nmod:poss(dog-2, My-1) nsubj(likes-3, dog-2) root(ROOT-0, likes-3) mark(eat-5, to-4) xcomp(likes-3, eat-5) dobj(eat-5, yoghurt-6)",
167+
"nmod:poss(dog-2, My-1) nsubj(likes-3, dog-2) nsubj(eat-5, dog-2) root(ROOT-0, likes-3) mark(eat-5, to-4) xcomp(likes-3, eat-5) dobj(eat-5, yoghurt-6)");
168168
}
169169

170170
/**

src/edu/stanford/nlp/trees/GrammaticalStructure.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ private List<TypedDependency> getDeps(Predicate<TypedDependency> puncTypedDepFil
529529
}
530530
}
531531
}
532+
532533
if (rootDep != null) {
533534
TypedDependency rootTypedDep = new TypedDependency(ROOT, new IndexedWord(dependencyRoot.label()), new IndexedWord(rootDep.label()));
534535
if (puncTypedDepFilter.test(rootTypedDep)) {
@@ -641,7 +642,7 @@ public boolean test(TypedDependency d) {
641642
IndexedWord l = d.dep();
642643
if (l == null) return false;
643644

644-
return npf.test(l.word()) && tf.test(l.tag());
645+
return npf.test(l.value()) && tf.test(l.tag());
645646
}
646647

647648
// Automatically generated by Eclipse

0 commit comments

Comments
 (0)