Skip to content

Commit 79833b4

Browse files
committed
Split the context mappings into two separate arrays - this gives us a place to reuse the AUX mappings from UniversalEnglishGrammaticalRelations
1 parent 75e8b88 commit 79833b4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,20 @@ public static void load() {
5757
// Context-sensitive mappings
5858
// ------------------------------
5959

60-
String [][] contextMappings = new String [][] {
60+
String [][] toContextMappings = new String [][] {
6161
// TO -> PART (in CONJP phrases)
6262
{ "@CONJP < TO=target < VB", "PART", },
6363
{ "@VP < @VP < (/^TO$/=target <... {/.*/})", "PART", },
6464
{ "@VP <: (/^TO$/=target <... {/.*/})", "PART", },
6565
{ "TO=target <... {/.*/}", "ADP", }, // otherwise TO -> ADP
66+
};
67+
for (String[] newOp : toContextMappings) {
68+
operations.add(new Pair<>(TregexPattern.compile(newOp[0]),
69+
Tsurgeon.parseOperation("relabel target " + newOp[1])));
70+
71+
}
72+
73+
String [][] otherContextMappings = new String [][] {
6674
// Don't do this, we are now treating these as copular constructions
6775
// VB.* -> AUX (for passives where main verb is part of an ADJP)
6876
// @VP < (/^VB/=target < /^(?i:am|is|are|r|be|being|'s|'re|'m|was|were|been|s|ai|m|art|ar|wase|get|got|getting|gets|gotten)$/ ) < (@ADJP [ < VBN|VBD | < (@VP|ADJP < VBN|VBD) < CC ] )
@@ -134,7 +142,7 @@ public static void load() {
134142
// WDT -> DET
135143
{ "WDT=target <... {/.*/}", "DET" },
136144
};
137-
for (String[] newOp : contextMappings) {
145+
for (String[] newOp : otherContextMappings) {
138146
operations.add(new Pair<>(TregexPattern.compile(newOp[0]),
139147
Tsurgeon.parseOperation("relabel target " + newOp[1])));
140148

0 commit comments

Comments
 (0)