commit | 9f19592f899b23d2eeceb5a9a1d27ac7c4957a1f | [log] [tgz] |
---|---|---|
author | Nils Diewald <nils@diewald-online.de> | Mon Nov 03 22:16:15 2014 +0000 |
committer | Nils Diewald <nils@diewald-online.de> | Mon Nov 03 22:16:15 2014 +0000 |
tree | 310e8fb86ed28083368834106a3fd424dccd0fc9 | |
parent | 78674671121388c3976b1a4c237d9431f8d0c189 [diff] |
Consistent offset checks for spans and tokens
diff --git a/lib/KorAP/Tokenizer/Units.pm b/lib/KorAP/Tokenizer/Units.pm index 8130cb9..baa9ed2 100644 --- a/lib/KorAP/Tokenizer/Units.pm +++ b/lib/KorAP/Tokenizer/Units.pm
@@ -14,6 +14,8 @@ ($from, $to) = $self->_offset($from, $to); + return if !$to; + $from ||= 0; return unless $to > $from; my $span = KorAP::Tokenizer::Span->new;