Skip to content

Commit 64a998a

Browse files
committed
If the Corrector is used, use its xpos tags as well when building the conll
1 parent 65a6b4f commit 64a998a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/edu/stanford/nlp/trees/ud/UniversalDependenciesConverter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,12 @@ public static void main(String[] args) {
288288
Tree tree = ((TreeToSemanticGraphIterator) sgIterator).getCurrentTree();
289289
if (ptbCorrector != null) {
290290
tree = ptbCorrector.transformTree(tree);
291+
List<Label> xposLabels = tree.preTerminalYield();
292+
for (IndexedWord token: sg.vertexListSorted()) {
293+
int idx = token.index() - 1;
294+
String xposTag = xposLabels.get(idx).value();
295+
token.set(CoreAnnotations.PartOfSpeechAnnotation.class, xposTag);
296+
}
291297
}
292298
Tree uposTree = UniversalPOSMapper.mapTree(tree);
293299
List<Label> uposLabels = uposTree.preTerminalYield();

0 commit comments

Comments
 (0)