21
21
public class RuleBasedParser extends AbstractSceneGraphParser {
22
22
23
23
/* A man is riding a horse. */
24
- public static SemgrexPattern SUBJ_PRED_OBJ_TRIPLET_PATTERN = SemgrexPattern .compile ("{}=pred >nsubj {tag:/NNP?S?/}=subj >/(iobj|dobj |nmod:.*)/=objreln {tag:/NNP?S?/}=obj !> cop {}" );
24
+ public static SemgrexPattern SUBJ_PRED_OBJ_TRIPLET_PATTERN = SemgrexPattern .compile ("{}=pred >nsubj {tag:/NNP?S?/}=subj >/(iobj|obj |nmod:.*|obl :.*)/=objreln {tag:/NNP?S?/}=obj !> cop {}" );
25
25
26
26
/* A woman is smiling. */
27
- public static SemgrexPattern SUBJ_PRED_PAIR_PATTERN = SemgrexPattern .compile ("{}=pred >nsubj {tag:/NNP?S?/}=subj !>/(iobj|dobj |nmod:.*)/ {tag:/NNP?S?/} !>cop {}" );
27
+ public static SemgrexPattern SUBJ_PRED_PAIR_PATTERN = SemgrexPattern .compile ("{}=pred >nsubj {tag:/NNP?S?/}=subj !>/(iobj|obj |nmod:.*|obl :.*)/ {tag:/NNP?S?/} !>cop {}" );
28
28
29
29
/* The man is a rider. */
30
30
public static SemgrexPattern COPULAR_PATTERN = SemgrexPattern .compile ("{}=pred >nsubj {tag:/NNP?S?/}=subj >cop {}" );
@@ -36,16 +36,16 @@ public class RuleBasedParser extends AbstractSceneGraphParser {
36
36
public static SemgrexPattern ADJ_PRED_PATTERN = SemgrexPattern .compile ("{tag:/J.*/}=adj >nsubj {}=obj" );
37
37
38
38
/* A woman is in the house. */
39
- public static SemgrexPattern PP_MOD_PATTERN = SemgrexPattern .compile ("{tag:/NNP?S?/}=gov >/nmod:.*/=reln {}=mod" );
39
+ public static SemgrexPattern PP_MOD_PATTERN = SemgrexPattern .compile ("{tag:/NNP?S?/}=gov >/( nmod:.*|obl:.*) /=reln {}=mod" );
40
40
41
41
/* His watch. */
42
42
public static SemgrexPattern POSS_PATTERN = SemgrexPattern .compile ("{tag:/NNP?S?/}=gov >/nmod:poss/=reln {tag:/NNP?S?/}=mod" );
43
43
44
44
/* */
45
- public static SemgrexPattern AGENT_PATTERN = SemgrexPattern .compile ("{tag:/V.*/}=pred >/nmod :agent/=reln {tag:/NNP?S?/}=subj >nsubjpass {tag:/NNP?S?/}=obj " );
45
+ public static SemgrexPattern AGENT_PATTERN = SemgrexPattern .compile ("{tag:/V.*/}=pred >/obl :agent/=reln {tag:/NNP?S?/}=subj >/nsubj:pass/ {tag:/NNP?S?/}=obj " );
46
46
47
47
/* A cat sitting in a chair. */
48
- public static SemgrexPattern ACL_PATTERN = SemgrexPattern .compile ("{}=subj >acl ({tag:/V.*/}=pred >/(iobj|dobj |nmod:.*)/=objreln {tag:/NNP?S?/}=obj)" );
48
+ public static SemgrexPattern ACL_PATTERN = SemgrexPattern .compile ("{}=subj >acl ({tag:/V.*/}=pred >/(iobj|obj |nmod:.*|obl :.*)/=objreln {tag:/NNP?S?/}=obj)" );
49
49
50
50
//TODO: do something special with nmod:by
51
51
0 commit comments