Skip to content

Commit 396741e

Browse files
committed
Run a TreeTransformer that gets rid of the functional tags other than TMP on the NPs before using the POS conversions. This also greatly reduces the number of validation errors, especially thanks to the AUX rules now matching for NP-stuff whereas before it would not match those
1 parent ce33462 commit 396741e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ public class UniversalPOSMapper {
5151

5252
private static List<Pair<TregexPattern, TsurgeonPattern>> operations; // = null;
5353

54+
private static TreeTransformer transformer;
55+
5456
private UniversalPOSMapper() {} // static methods
5557

5658
public static void load() {
59+
transformer = new DependencyTreeTransformer();
60+
5761
operations = new ArrayList<>();
5862
// ------------------------------
5963
// Context-sensitive mappings
@@ -206,7 +210,9 @@ public static Tree mapTree(Tree t) {
206210
return t;
207211
}
208212

209-
return Tsurgeon.processPatternsOnTree(operations, t.deepCopy());
213+
t = t.deepCopy();
214+
t = transformer.transformTree(t);
215+
return Tsurgeon.processPatternsOnTree(operations, t);
210216
}
211217

212218
}

0 commit comments

Comments
 (0)