Akron | 8b511f9 | 2020-07-09 17:28:08 +0200 | [diff] [blame] | 1 | #!/usr/bin/env perl |
| 2 | use strict; |
| 3 | use warnings; |
| 4 | use FindBin; |
| 5 | BEGIN { |
| 6 | unshift @INC, "$FindBin::Bin/../../lib"; |
| 7 | }; |
| 8 | use KorAP::XML::TEI::Tokenizer::Aggressive; |
| 9 | |
Akron | 8b511f9 | 2020-07-09 17:28:08 +0200 | [diff] [blame] | 10 | $| = 1; |
| 11 | |
| 12 | # Init tokenizer |
| 13 | my $tok = KorAP::XML::TEI::Tokenizer::Aggressive->new; |
| 14 | |
| 15 | # Read lines from input and return boundaries |
| 16 | while (!eof(STDIN)) { |
| 17 | my $line = <>; |
Marc Kupietz | 52dc21b | 2020-09-05 13:51:22 +0200 | [diff] [blame] | 18 | for my $text (split(/\n?\x{04}\n?/, $line)) { |
| 19 | $tok->tokenize($text); |
| 20 | print join(' ', $tok->boundaries), "\n"; |
| 21 | $tok->reset; |
| 22 | } |
Akron | 8b511f9 | 2020-07-09 17:28:08 +0200 | [diff] [blame] | 23 | }; |
| 24 | |
| 25 | 1; |