File tree Expand file tree Collapse file tree
lib/Treex/Block/HamleDT/CS Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ sub process_atree
3636 $self -> fix_annotation_errors($node );
3737 $self -> identify_acl_relcl($node );
3838 $self -> fix_copula_location($node );
39+ $self -> fix_adverb_mark($node );
3940 }
4041 # It is possible that we changed the form of a multi-word token.
4142 # Therefore we must re-generate the sentence text.
@@ -607,6 +608,24 @@ sub fix_copula_location
607608
608609
609610
611+ # ------------------------------------------------------------------------------
612+ # If an adverb ends up attached as mark, something is wrong. Either it should
613+ # be subordinator rather than adverb, or it should be advmod rather than mark.
614+ # Based on observed cases, we choose the latter solution. Note that it would
615+ # be difficult to fix this earlier: If the adverb was AuxC in PDT, the PDT
616+ # tree structure was quite different from UD.
617+ # ------------------------------------------------------------------------------
618+ sub fix_adverb_mark
619+ {
620+ my $self = shift ;
621+ my $node = shift ;
622+ return unless ($node -> is_adverb());
623+ return unless ($node -> deprel() =~ m / ^mark(:|$ )/ );
624+ $node -> set_deprel(' advmod' );
625+ }
626+
627+
628+
610629# ------------------------------------------------------------------------------
611630# Converts dependency relations from UD v1 to v2.
612631# ------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments