Skip to content

Commit ce33462

Browse files
committedMar 14, 2024·
Add a DEBUG flag to the UniversalPOSMapper which outputs the automatically generated tregex/tsurgeons
1 parent 30f2f8e commit ce33462

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

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

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public class UniversalPOSMapper {
4242
/** A logger for this class */
4343
private static final Redwood.RedwoodChannels log = Redwood.channels(UniversalPOSMapper.class);
4444

45+
private static final boolean DEBUG = System.getProperty("UniversalPOSMapper", null) != null;
46+
4547
@SuppressWarnings("WeakerAccess")
4648
public static final String DEFAULT_TSURGEON_FILE = "edu/stanford/nlp/models/upos/ENUniversalPOS.tsurgeon";
4749

@@ -87,6 +89,9 @@ public static void load() {
8789
newTregex = pattern.pattern() + ": (=target == /^(?:VB)/)";
8890
newTsurgeon = "relabel target AUX";
8991
}
92+
if (DEBUG) {
93+
System.err.println(newTregex + "\n " + newTsurgeon);
94+
}
9095
operations.add(new Pair<>(TregexPattern.compile(newTregex),
9196
Tsurgeon.parseOperation(newTsurgeon)));
9297
}

0 commit comments

Comments
 (0)
Please sign in to comment.