Replace deprecated MultiTerm add() method from MDParser

Change-Id: Iada2a3cc2f1b09e8b8b101509d66de63d70e911f
diff --git a/lib/KorAP/XML/Annotation/MDParser/Dependency.pm b/lib/KorAP/XML/Annotation/MDParser/Dependency.pm
index 8816f1f..bb8b1ca 100644
--- a/lib/KorAP/XML/Annotation/MDParser/Dependency.pm
+++ b/lib/KorAP/XML/Annotation/MDParser/Dependency.pm
@@ -26,6 +26,8 @@
       my $rel = $content->{rel};
       $rel = [$rel] unless ref $rel eq 'ARRAY';
 
+      my ($mt, $target, $target_mtt);
+
       # Iterate over relations
       foreach (@$rel) {
         my $label = $_->{-label};
@@ -35,40 +37,37 @@
         my $to   = $_->{span}->{-to};
 
         # Target
-        my $target = $tokens->token($from, $to);
+        $target = $tokens->token($from, $to);
 
         # Relation is term-to-term with a found target!
         if ($target) {
 
           # Unary means, it refers to itself!
-          $mtt->add(
-            term => '>:mdp/d:' . $label,
-            pti => 32, # term-to-term relation
-            payload =>
-              '<i>' . $target->get_pos # . # right part token position
+          $mt = $mtt->add_by_term('>:mdp/d:' . $label);
+          $mt->set_pti(32); # term-to-term relation
+          $mt->set_payload(
+            '<i>' . $target->get_pos # . # right part token position
               # '<s>0' . # $source_term->tui . # left part tui
               # '<s>0' # . $target_term->tui # right part tui
-            );
+          );
 
-          my $target_mtt = $stream->pos($target->get_pos);
+          $target_mtt = $stream->pos($target->get_pos);
 
-          $target_mtt->add(
-            term => '<:mdp/d:' . $label,
-            pti => 32, # term-to-term relation
-            payload =>
-              '<i>' . $source->get_pos # . # left part token position
+          $mt = $target_mtt->add_by_term('<:mdp/d:' . $label);
+          $mt->set_pti(32); # term-to-term relation
+          $mt->set_payload(
+            '<i>' . $source->get_pos # . # left part token position
               # '<s>0' . # $source_term->tui . # left part tui
               # '<s>0' # . $target_term->tui # right part tui
-            );
+          );
         }
 
         # Relation is possibly term-to-element with a found target!
         elsif ($target = $tokens->span($from, $to)) {
-          $mtt->add(
-            term => '>:mdp/d:' . $label,
-            pti => 33, # term-to-element relation
-            payload =>
-              '<i>' . $target->get_o_start . # end position
+          $mt = $mtt->add_by_term('>:mdp/d:' . $label);
+          $mt->set_pti(33); # term-to-element relation
+          $mt->set_payload(
+            '<i>' . $target->get_o_start . # end position
               '<i>' . $target->get_o_end . # end position
               '<i>' . $target->get_p_start . # right part start position
               '<i>' . $target->get_p_end # . # right part end position
@@ -76,12 +75,11 @@
               # '<s>0' # . $target_span->tui # right part tui
             );
 
-          my $target_mtt = $stream->pos($target->get_p_start);
-          $target_mtt->add(
-            term => '<:mdp/d:' . $label,
-            pti => 34, # element-to-term relation
-            payload =>
-              '<i>' . $target->get_o_start . # end position
+          $target_mtt = $stream->pos($target->get_p_start);
+          $mt = $target_mtt->add_by_term('<:mdp/d:' . $label);
+          $mt->set_pti(34); # element-to-term relation
+          $mt->set_payload(
+            '<i>' . $target->get_o_start . # end position
               '<i>' . $target->get_o_end . # end position
               '<i>' . $target->get_p_end . # right part end position
               '<i>' . $source->get_pos # . # left part token position