Skip to content

Commit

Permalink
patch deprel if contains crazy character with 'dep' value (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
matyaskopp committed Apr 1, 2021
1 parent ceb6abd commit 4527f2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/udpipe2/udpipe2.pl
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,10 @@ sub add_token {
$self->logger("ERROR: root deprel inside tree (replacing with dep) $id");
$opts{deprel} = 'dep';
}
if($opts{deprel} =~ m/[^a-zA-Z_:]/) {
$self->logger("ERROR: invalid character in deprel '$opts{deprel}' (replacing with dep) $id");
$opts{deprel} = 'dep';
}
push @{$self->{deprel}}, {src => $opts{i}, head => $opts{head}, deprel => $opts{deprel}};

}
Expand Down

0 comments on commit 4527f2b

Please sign in to comment.