Skip to content

Commit ad4556d

Browse files
committed
Converter can compensate for an error in the parser for vmod (SD) and acl (UD) by looking for NML where there should be an NP. #1363
1 parent 5745de5 commit ad4556d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -1111,8 +1111,10 @@ private EnglishGrammaticalRelations() {}
11111111
// "VP < (/^S-ADV$/=target < (VP <, VBG|VBN) )",
11121112
// they wrote asking the SEC to ...
11131113
"VP < (S=target $-- NP < (VP < TO) !$-- (/^V/ < " + xcompVerbRegex + ") )",
1114-
"/^NP(?:-[A-Z]+)?$/ < (S=target < (VP < TO) $-- NP|NN|NNP|NNS)",
1115-
"/^NP(?:-[A-Z]+)?$/ < (SBAR=target < (S < (VP < TO)) $-- NP|NN|NNP|NNS)",
1114+
// NML in the following rules is to cover some errors by the parser
1115+
// It makes no difference to PTB
1116+
"/^NP(?:-[A-Z]+)?$/ < (S=target < (VP < TO) $-- NP|NN|NNP|NNS|NML)",
1117+
"/^NP(?:-[A-Z]+)?$/ < (SBAR=target < (S < (VP < TO)) $-- NP|NN|NNP|NNS|NML)",
11161118
"SBARQ < WHNP < (S=target < (VP <1 TO))");
11171119

11181120

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -1027,9 +1027,10 @@ private UniversalEnglishGrammaticalRelations() {}
10271027
//former pcomp
10281028
"/^(?:(?:WH)?(?:NP|NX|NML)(?:-TMP|-ADV)?)$/ < (WHPP|WHPP-TMP|PP|PP-TMP=target !< @NP|WHNP|NML !$- (@CC|CONJP $- __) < /^((?!(PP|CC|CONJP|,)).)*$/ !< (@PP <1 IN|RB|MWE|PCONJP|VBN|JJ <2 @NP)) !<- " + ETC_PAT + " !<- " + FW_ETC_PAT,
10291029

1030-
1031-
"/^NP(?:-[A-Z]+)?$/ < (S=target < (VP < TO) $-- NP|NN|NNP|NNS)",
1032-
"/^NP(?:-[A-Z]+)?$/ < (SBAR=target < (S < (VP < TO)) $-- NP|NN|NNP|NNS)");
1030+
// NML in the following rules is to cover some errors by the parser
1031+
// It makes no difference to PTB
1032+
"/^NP(?:-[A-Z]+)?$/ < (S=target < (VP < TO) $-- NP|NN|NNP|NNS|NML)",
1033+
"/^NP(?:-[A-Z]+)?$/ < (SBAR=target < (S < (VP < TO)) $-- NP|NN|NNP|NNS|NML)");
10331034
// [todo [cdm2019]: Add somthing for clause acl not acl:relcl like: (NP (NP no question) (SBAR that (S (NP some) (VP contracted (NP diseases)))))
10341035

10351036
/**

0 commit comments

Comments
 (0)