Remove deprecated last_token method from Annotations::Collector
Change-Id: I8eb93561a25a54b780a0243d13e4c5abe4a1e695
diff --git a/lib/KorAP/XML/TEI/Annotations/Collector.pm b/lib/KorAP/XML/TEI/Annotations/Collector.pm
index 2b13081..9a7ea05 100644
--- a/lib/KorAP/XML/TEI/Annotations/Collector.pm
+++ b/lib/KorAP/XML/TEI/Annotations/Collector.pm
@@ -26,13 +26,6 @@
};
-# Get last token added to the tokens list
-sub last_token {
- # DEPRECATED
- $_[0]->[$#{$_[0]}];
-};
-
-
# Stringify all tokens
sub to_string {
my ($self, $text_id, $param) = @_;
@@ -54,7 +47,7 @@
# correct last from-value (if the 'second to last'
# from-value refers to an s-tag, then the last from-value
# is one to big - see retr_info())
- my $last_token = $self->last_token;
+ my $last_token = $_[0]->[$#{$_[0]}];
if ($last_token->from == $last_token->to + 1) {
# TODO:
# check
diff --git a/t/annotations-collect.t b/t/annotations-collect.t
index 1a8c45f..543e693 100644
--- a/t/annotations-collect.t
+++ b/t/annotations-collect.t
@@ -26,7 +26,7 @@
->attr_is('span fs f', 'name', 'lex')
;
-$loy = Test::XML::Loy->new($t->last_token->to_string(3));
+$loy = Test::XML::Loy->new($t->[-1]->to_string(3));
$loy->attr_is('span', 'id', 's3')
->attr_is('span', 'from', 15)