Skip to content

Commit

Permalink
Add a DEBUG flag to the UniversalPOSMapper which outputs the automati…
Browse files Browse the repository at this point in the history
…cally generated tregex/tsurgeons
  • Loading branch information
AngledLuffa committed Mar 14, 2024
1 parent 30f2f8e commit ce33462
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/edu/stanford/nlp/trees/UniversalPOSMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public class UniversalPOSMapper {
/** A logger for this class */
private static final Redwood.RedwoodChannels log = Redwood.channels(UniversalPOSMapper.class);

private static final boolean DEBUG = System.getProperty("UniversalPOSMapper", null) != null;

@SuppressWarnings("WeakerAccess")
public static final String DEFAULT_TSURGEON_FILE = "edu/stanford/nlp/models/upos/ENUniversalPOS.tsurgeon";

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

0 comments on commit ce33462

Please sign in to comment.