Quick fix for XIP::Dependency
Change-Id: I79422ae09b665acac45598f26c1c1ef627a4723e
diff --git a/lib/KorAP/XML/Annotation/XIP/Dependency.pm b/lib/KorAP/XML/Annotation/XIP/Dependency.pm
index 5ed5912..a1bfb15 100644
--- a/lib/KorAP/XML/Annotation/XIP/Dependency.pm
+++ b/lib/KorAP/XML/Annotation/XIP/Dependency.pm
@@ -35,28 +35,24 @@
if ($_->{-type} && $_->{-type} eq 'unary') {
$mt = $mtt->add_by_term('>:xip/d:' . $label);
$mt->set_payload('<i>' . $token->get_pos);
+ $mt = $mtt->add_by_term('<:xip/d:' . $label);
+ $mt->set_payload('<i>' . $token->get_pos);
+ }
+ else {
+ my $from = $_->{span}->{-from};
+ my $to = $_->{span}->{-to};
+
+ my $rel_token = $tokens->token($from, $to) or next;
+ $mt = $mtt->add_by_term('>:xip/d:' . $label);
+ $mt->set_payload('<i>' . $rel_token->get_pos);
+
+ $mt = $stream->pos($rel_token->get_pos)
+ ->add_by_term('<:xip/d:' . $label);
+ $mt->set_payload('<i>' . $token->get_pos);
};
- $mt = $mtt->add_by_term('<:xip/d:' . $label);
- $mt->set_payload('<i>' . $token->get_pos);
- }
- else {
-
- my $from = $_->{span}->{-from};
- my $to = $_->{span}->{-to};
-
- my $rel_token = $tokens->token($from, $to) or next;
-
- $mt = $mtt->add_by_term('>:xip/d:' . $label);
- $mt->set_payload('<i>' . $rel_token->get_pos);
- );
-
- $mt = $stream->pos($rel_token->get_pos)
- ->add_by_term('<:xip/d:' . $label);
- $mt->set_payload('<i>' . $token->get_pos);
-
- }
- ) or return;
+ };
+ }) or return;
return 1;
};