Skip to content

Commit 4a70cf3

Browse files
committed
Do not attach adverbs as mark.
1 parent e0abb39 commit 4a70cf3

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

lib/Treex/Block/HamleDT/CS/FixUD.pm

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff 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
#------------------------------------------------------------------------------

0 commit comments

Comments
 (0)