Skip to content

Commit 61ef545

Browse files
committed
Separate off the NML part of the nn relationship so that we can do it without the comma restriction. This especially finds lists of NML as nn modifiers of a noun
1 parent 133ddd8 commit 61ef545

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,10 @@ private EnglishGrammaticalRelations() {}
10181018
public static final GrammaticalRelation NOUN_COMPOUND_MODIFIER =
10191019
new GrammaticalRelation(Language.English, "nn", "nn modifier",
10201020
MODIFIER, "(?:WH)?(?:NP|NX|NAC|NML|ADVP|ADJP)(?:-TMP|-ADV)?", tregexCompiler,
1021-
"/^(?:WH)?(?:NP|NX|NAC|NML)(?:-TMP|-ADV)?$/ < (NP|NML|NN|NNS|NNP|NNPS|FW|AFX=target $++ NN|NNS|NNP|NNPS|FW|CD=sister !<<- POS !<<- (VBZ < /^[\'’]s$/) !$- /^,$/ !$++ (POS $++ =sister))",
1021+
"/^(?:WH)?(?:NP|NX|NAC|NML)(?:-TMP|-ADV)?$/ < (NP|NN|NNS|NNP|NNPS|FW|AFX=target $++ NN|NNS|NNP|NNPS|FW|CD=sister !<<- POS !<<- (VBZ < /^[\'’]s$/) !$- /^,$/ !$++ (POS $++ =sister))",
1022+
// same thing as the above, but without the comma. NML in such a situation is typically a noun phrase modifying a noun,
1023+
// whereas other nodes such as NN can be parts of lists or otherwise unsuitable for the nn relationship
1024+
"/^(?:WH)?(?:NP|NX|NAC|NML)(?:-TMP|-ADV)?$/ < (NML=target $++ NN|NNS|NNP|NNPS|FW|CD=sister !<<- POS !<<- (VBZ < /^[\'’]s$/) !$++ (POS $++ =sister))",
10221025
"/^(?:WH)?(?:NP|NX|NAC|NML)(?:-TMP|-ADV)?$/ < JJ|JJR|JJS=sister < (NP|NML|NN|NNS|NNP|NNPS|FW=target !<<- POS !<<- (VBZ < /^[\'’]s$/) $+ =sister) <# NN|NNS|NNP|NNPS !<<- POS !<<- (VBZ < /^[\'’]s$/) ",
10231026
// in vitro, in vivo, etc., in Genia
10241027
// matches against "etc etc"

0 commit comments

Comments
 (0)