« blib/lib/Lingua/Ogmios/NLPWrappers/BasicSentenceSegmentizer.pm
↑ Summary
blib/lib/Lingua/Ogmios/Annotations.pm »
| 1 | package Lingua::Ogmios::NLPWrappers::HeidelTime; | ||
| 2 | |||
| 3 | |||
| 4 | our $VERSION='0.1'; | ||
| 5 | |||
| 6 | use Lingua::Ogmios::NLPWrappers::Wrapper; | ||
| 7 | |||
| 8 | # use XML::LibXML; | ||
| 9 | |||
| 10 | use strict; | ||
| 11 | use warnings; | ||
| 12 | |||
| 13 | our @ISA = qw(Lingua::Ogmios::NLPWrappers::Wrapper); | ||
| 14 | |||
| 15 | sub new { | ||
| 16 | my ($class, $config, $tmpfile_prefix, $logfile, $position, $no_standard_output) = @_; | ||
| 17 | |||
| 18 | my $lang; | ||
| 19 | my $lang2; | ||
| 20 | |||
| 21 | warn "[LOG] Creating a wrapper of the HeidelTime\n"; | ||
| 22 | |||
| 23 | my $HeidelTime = $class->SUPER::new($config, $tmpfile_prefix, $logfile, $position, $no_standard_output); | ||
| 24 | |||
| 25 | if (defined $HeidelTime->_config->configuration->{'CONFIG'}) { | ||
| 26 | foreach $lang (keys %{$HeidelTime->_config->configuration->{'CONFIG'}}) { | ||
| 27 | if ($lang =~ /language=([\w]+)/io) { | ||
| 28 | $lang2 = $1; | ||
| 29 | $HeidelTime->_setOption($lang2, "EXPAND_TERMS", "EXPAND_TERMS", 0); | ||
| 30 | $HeidelTime->_setOption($lang2, "MERGE_TERMS", "MERGE_TERMS", 0); | ||
| 31 | $HeidelTime->_setOption($lang2, "USE_DCT", "use_dct", 0); | ||
| 32 | $HeidelTime->_setOption($lang2, "ROOTSEMF", "root_semf", undef); | ||
| 33 | # $HeidelTime->_setOption($lang2, "CASE_SENSITIVE", "CaseSensitive", -1); | ||
| 34 | } | ||
| 35 | } | ||
| 36 | } | ||
| 37 | |||
| 38 | $HeidelTime->_input_filename($tmpfile_prefix . ".HeidelTime.in"); | ||
| 39 | $HeidelTime->_output_filename($tmpfile_prefix . ".HeidelTime.out"); | ||
| 40 | |||
| 41 | return($HeidelTime); | ||
| 42 | |||
| 43 | } | ||
| 44 | |||
| 45 | sub _processHeidelTime { | ||
| 46 | my ($self, $lang) = @_; | ||
| 47 | |||
| 48 | warn "[LOG] HeidelTime\n"; | ||
| 49 | |||
| 50 | $lang = $self->_documentSet->[0]->getAnnotations->getLanguage; | ||
| 51 | |||
| 52 | warn "[LOG] *** for the moment, ONLY for ONE document - the first ;-)\n"; | ||
| 53 | |||
| 54 | my $command_line = $self->_config->commands($lang)->{HeidelTime_CMD} . " " . $self->_input_filename . " " . $self->_config->commands($lang)->{HeidelTime_OPT}; | ||
| 55 | if (((!(defined($self->{"use_dct"}->{$lang}))) || ($self->{"use_dct"}->{$lang} == 1)) && | ||
| 56 | (defined $self->_documentSet->[0]->getAnnotations->getProperty("AdmissionDate"))) { | ||
| 57 | # warn "use dct\n"; | ||
| 58 | $command_line .= " " . $self->_config->commands($lang)->{HeidelTime_DCTSWITCH} . " " . $self->_documentSet->[0]->getAnnotations->getProperty("AdmissionDate"); | ||
| 59 | } | ||
| 60 | if (defined $self->_config->commands($lang)) { | ||
| 61 | return($self->_exec_command($self->_defineCommandLine($command_line, undef, $self->_output_filename))); | ||
| 62 | } else { | ||
| 63 | warn "Heideltime not defined for $lang\n"; | ||
| 64 | return(undef); | ||
| 65 | } | ||
| 66 | |||
| 67 | warn "[LOG]\n"; | ||
| 68 | } | ||
| 69 | |||
| 70 | sub _inputHeidelTime { | ||
| 71 | my ($self) = @_; | ||
| 72 | |||
| 73 | my $sentence; | ||
| 74 | my $corpus_in = ""; | ||
| 75 | my $document; | ||
| 76 | |||
| 77 | warn "[LOG] making HeidelTime input\n"; | ||
| 78 | |||
| 79 | foreach $document (@{$self->_documentSet}) { | ||
| 80 | foreach $sentence (@{$document->getAnnotations->getSentenceLevel->getElements}) { | ||
| 81 | # foreach $token (@{$document->getAnnotations->getTokenLevel->getElements}) { | ||
| 82 | $corpus_in .= $sentence->getForm; | ||
| 83 | # if ($document->getAnnotations->getSectionLevel->existsElementFromIndex("to", $token->getId)) { | ||
| 84 | $corpus_in .= "\n"; | ||
| 85 | # } | ||
| 86 | } | ||
| 87 | } | ||
| 88 | $corpus_in =~ s/[\x{A0}\x{2000}-\x{200B}]/ /go; | ||
| 89 | $corpus_in =~ s/[\x{2019}\x{2032}]/\'/go; | ||
| 90 | |||
| 91 | $corpus_in =~ s/\n\n+/\n/go; | ||
| 92 | open FILE_IN, ">:utf8", $self->_input_filename; | ||
| 93 | print FILE_IN $corpus_in; | ||
| 94 | close FILE_IN; | ||
| 95 | |||
| 96 | warn "[LOG] done\n"; | ||
| 97 | } | ||
| 98 | |||
| 99 | |||
| 100 | sub _outputHeidelTime { | ||
| 101 | my ($self) = @_; | ||
| 102 | |||
| 103 | my $lang = $self->_documentSet->[0]->getAnnotations->getLanguage; | ||
| 104 | warn "[LOG] . Parsing " . $self->_output_filename . "\n"; | ||
| 105 | |||
| 106 | warn "[LOG] *** for the moment, ONLY for ONE document - the first ;-)\n"; | ||
| 107 | |||
| 108 | my $document; | ||
| 109 | my $line; | ||
| 110 | my $i; | ||
| 111 | |||
| 112 | open FILE, $self->_output_filename or die "no such file " . $self->_output_filename . "\n"; | ||
| 113 | binmode(FILE, ":utf8"); | ||
| 114 | while($line = <FILE>) { | ||
| 115 | if ($line =~ /^<TimeML>/) { | ||
| 116 | last | ||
| 117 | }; | ||
| 118 | } | ||
| 119 | $line = <FILE>; | ||
| 120 | $i = 0; | ||
| 121 | |||
| 122 | my $tokenStart; | ||
| 123 | my $tokenEnd; | ||
| 124 | my $offset=0; | ||
| 125 | my $term; | ||
| 126 | my $start_sentence_offset; | ||
| 127 | my $semFeatures; | ||
| 128 | my $type; | ||
| 129 | my $mod; | ||
| 130 | my %weights; | ||
| 131 | my $lineold; | ||
| 132 | my $value; | ||
| 133 | my @semfTab; | ||
| 134 | |||
| 135 | my @undefinedRef; | ||
| 136 | |||
| 137 | # <TIMEX3 tid="t0" type="DATE" value="2000-02-01">02/01/2000</TIMEX3> | ||
| 138 | |||
| 139 | # my @sentences = $document->getAnnotations->getSentenceLevel->getElements; | ||
| 140 | $document = $self->_documentSet->[0]; | ||
| 141 | |||
| 142 | while($line = <FILE>) { | ||
| 143 | if ($line =~ /<\/TimeML>/) { | ||
| 144 | last; | ||
| 145 | } else { | ||
| 146 | # warn "i= $i\n"; | ||
| 147 | # Signed electronically by : DR. Bernice Jenkins on : FRI <TIMEX3 tid="t42" type="TIME" value="2011-10-07T4:01">2011-10-07 <TIM</TIMEX3>EX3 tid="t44" type="TIME" value="2011-10-07T16:01">4:01 PM</TIMEX3> | ||
| 148 | # $line =~ s///g; | ||
| 149 | # $start_sentence = $document->getAnnotations->getSentenceLevel->getElements->[$i]->start_token; | ||
| 150 | $start_sentence_offset = $document->getAnnotations->getSentenceLevel->getElements->[$i]->start_token->getFrom; | ||
| 151 | while ($line =~ /<TIMEX3 tid=\"(?<tid>[^"]+)\" type=\"(?<type>[^"]+)\" value=\"(?<value>[^"]+)\"( mod=\"(?<mod>[^"]+)\")?( quant=\"(?<quant>[^"]+)\")?( freq=\"(?<freq>[^"]+)\")?>(?<timex>.*?)<\/TIMEX3>/) { | ||
| 152 | # while ($line =~ /<TIMEX3 tid=\"(?<tid>[^"]+)\" type=\"(?<type>[^"]+)\" value=\"(?<value>[^"]+)\"( mod=\"(?<mod>[^"]+)\")?( quant=\"(?<quant>[^"]+)\")?>(?<timex>.*?)<( freq=\"(?<freq>[^"]+)\")?\/TIMEX3>/) { | ||
| 153 | # warn "$line\n"; | ||
| 154 | $lineold = $line; | ||
| 155 | $line = $'; #' | ||
| 156 | $offset = length($`); | ||
| 157 | # $+{tid} | ||
| 158 | $type = lc($+{type}); | ||
| 159 | $mod=$+{mod}; | ||
| 160 | $value=uc($+{value}); | ||
| 161 | # warn "type: $type\n"; | ||
| 162 | if ($type eq "set") { | ||
| 163 | $type = "frequency"; | ||
| 164 | } | ||
| 165 | # if ($value eq "present_ref") { | ||
| 166 | # $value = ""; | ||
| 167 | # } | ||
| 168 | $start_sentence_offset += $offset; | ||
| 169 | # $start_sentence_offset--; | ||
| 170 | $tokenStart = $document->getAnnotations->getTokenLevel->getElementFromIndex('from', $start_sentence_offset)->[0]; | ||
| 171 | $tokenEnd = $document->getAnnotations->getTokenLevel->getElementFromIndex('to', $start_sentence_offset + length($+{timex}) - 1)->[0]; | ||
| 172 | if ((defined $tokenStart) && (defined $tokenEnd)) { | ||
| 173 | my $oldTerm = $document->getAnnotations->getSemanticUnitLevel->getElementByStartEndTokens($tokenStart, $tokenEnd); | ||
| 174 | if (defined $oldTerm) { | ||
| 175 | if ($oldTerm->isNamedEntity) { | ||
| 176 | $document->getAnnotations->delSemanticUnit($oldTerm); | ||
| 177 | $term = $self->_createTermFromStartEndTokens($document, $tokenStart,$tokenEnd); | ||
| 178 | } else { | ||
| 179 | $term = $oldTerm; | ||
| 180 | } | ||
| 181 | } else { | ||
| 182 | $term = $self->_createTermFromStartEndTokens($document, $tokenStart,$tokenEnd); | ||
| 183 | } | ||
| 184 | if (defined $term) { | ||
| 185 | # warn "\tAdd " . $term->getForm . " ($type - $mod - $value)\n"; | ||
| 186 | # warn "\tAdd " . $term->getForm . " ($type - $value)\n"; | ||
| 187 | %weights = ('relevance' => 2); | ||
| 188 | if ((defined $mod) && ($mod ne "")) { | ||
| 189 | # warn "add modality $mod - " . $term->type . "\n"; | ||
| 190 | $weights{'modality'} = $mod; | ||
| 191 | # warn join(":", %weights) . "\n"; | ||
| 192 | } | ||
| 193 | $self->_processValue(\$value, $term, \@undefinedRef); | ||
| 194 | |||
| 195 | $term->canonical_form($value); | ||
| 196 | |||
| 197 | $term->weights(\%weights); | ||
| 198 | $document->getAnnotations->addSemanticUnit($term); | ||
| 199 | if ((defined $self->{"root_semf"}->{$lang}) && ($self->{"root_semf"}->{$lang} ne "")) { | ||
| 200 | @semfTab = ('TIMEX3', $type); | ||
| 201 | } else { | ||
| 202 | @semfTab = ($type); | ||
| 203 | } | ||
| 204 | $semFeatures = Lingua::Ogmios::Annotations::SemanticFeatures->new( | ||
| 205 | { 'semantic_category' => [[@semfTab]], | ||
| 206 | 'refid_semantic_unit' => $term->getId, | ||
| 207 | }); | ||
| 208 | $document->getAnnotations->addSemanticFeatures($semFeatures); | ||
| 209 | } else { | ||
| 210 | warn "*** " . $+{timex} . "not found\n"; | ||
| 211 | } | ||
| 212 | } else { | ||
| 213 | if (!defined $tokenStart) { | ||
| 214 | warn "*** tokenStart not defined (" . $document->getAnnotations->getSentenceLevel->getElements->[$i]->start_token->getFrom . " - $start_sentence_offset - " . length($+{timex}) . ")\n"; | ||
| 215 | } | ||
| 216 | if (!defined $tokenEnd) { | ||
| 217 | warn "*** tokenEnd not defined (" . $document->getAnnotations->getSentenceLevel->getElements->[$i]->start_token->getFrom . " - $start_sentence_offset - " . length($+{timex}) . ")\n"; | ||
| 218 | } | ||
| 219 | warn "\tline: $lineold\n"; | ||
| 220 | warn "\t" . $document->getAnnotations->getSentenceLevel->getElements->[$i]->getForm . " ($i)\n"; | ||
| 221 | } | ||
| 222 | $start_sentence_offset += length($+{timex}); | ||
| 223 | # $start_sentence_offset--; | ||
| 224 | } | ||
| 225 | } | ||
| 226 | $i++; | ||
| 227 | } | ||
| 228 | |||
| 229 | close FILE; | ||
| 230 | |||
| 231 | if ((!(defined($self->{"MERGE_TERMS"}->{$lang}))) || ($self->{"MERGE_TERMS"}->{$lang} == 1)) { | ||
| 232 | # warn "Merge term\n"; | ||
| 233 | $self->_mergeTerms($document); | ||
| 234 | # TO REMOVe WHEN index deleting is OK | ||
| 235 | $document->getAnnotations->getSemanticUnitLevel->rebuildIndex; | ||
| 236 | $document->getAnnotations->getPhraseLevel->rebuildIndex; | ||
| 237 | $document->getAnnotations->getSemanticUnitLevel->rebuildIndex; | ||
| 238 | } | ||
| 239 | |||
| 240 | # eval { | ||
| 241 | # $document=$Parser->parse_file($self->_output_filename); | ||
| 242 | # }; | ||
| 243 | # if ($@){ | ||
| 244 | # warn "Parsing the doc failed: $@. Trying to get the IDs..\n"; | ||
| 245 | # } else { | ||
| 246 | # if ($document) { | ||
| 247 | # # $self->_parseDocumentCollection($document, $lingAnalysisLoad); | ||
| 248 | |||
| 249 | # my $root=$document->documentElement(); | ||
| 250 | # for $documentHT ($root->getChildrenByTagName('TimeML')) { | ||
| 251 | |||
| 252 | # } | ||
| 253 | |||
| 254 | # } else { | ||
| 255 | # warn "Parsing the doc failed. Doc " . $self->_output_filename . ")\n"; | ||
| 256 | # } | ||
| 257 | # } | ||
| 258 | |||
| 259 | warn "[LOG] done\n"; | ||
| 260 | } | ||
| 261 | |||
| 262 | sub run { | ||
| 263 | my ($self, $documentSet) = @_; | ||
| 264 | |||
| 265 | # Set variables according the the configuration | ||
| 266 | |||
| 267 | $self->_documentSet($documentSet); | ||
| 268 | |||
| 269 | warn "[LOG] " . $self->_config->comments . " ... \n"; | ||
| 270 | |||
| 271 | $self->_inputHeidelTime; | ||
| 272 | |||
| 273 | my $command_line = $self->_processHeidelTime; | ||
| 274 | |||
| 275 | # if ($self->_position eq "last") { | ||
| 276 | # # TODO | ||
| 277 | if (($self->_position eq "last") && ($self->_no_standard_output)) { | ||
| 278 | warn "print no standard output\n"; | ||
| 279 | } else { | ||
| 280 | $self->_outputHeidelTime; | ||
| 281 | } | ||
| 282 | # $self->_outputParsing; | ||
| 283 | |||
| 284 | |||
| 285 | # Put log information | ||
| 286 | |||
| 287 | my $information = { 'software_name' => $self->_config->name, | ||
| 288 | 'comments' => $self->_config->comments, | ||
| 289 | 'command_line' => $command_line, | ||
| 290 | 'list_modified_level' => [''], | ||
| 291 | }; | ||
| 292 | $self->_log($information); | ||
| 293 | |||
| 294 | |||
| 295 | # die "You call the 'rum' method of the wrapper class base\n | ||
| 296 | # You should define a 'run' method for your wrapper\n"; | ||
| 297 | warn "[LOG] done\n"; | ||
| 298 | } | ||
| 299 | |||
| 300 | sub _processValue { | ||
| 301 | my ($self, $valueRef, $term, $undefinedRef, $document) = @_; | ||
| 302 | |||
| 303 | my $value = $$valueRef; | ||
| 304 | my $valnum = 0; | ||
| 305 | my $repl; | ||
| 306 | |||
| 307 | # warn "value: $value\n"; | ||
| 308 | my %correspUnit = ( | ||
| 309 | 'D' => { 'value' => 24, | ||
| 310 | 'norm' => "H", | ||
| 311 | 'norm2' => 'T', | ||
| 312 | }, | ||
| 313 | 'H' => { 'value' => 60, | ||
| 314 | 'norm' => "M", | ||
| 315 | 'norm2' => 'T', | ||
| 316 | }, | ||
| 317 | 'W' => { 'value' => 7, | ||
| 318 | 'norm' => "D", | ||
| 319 | 'norm2' => '', | ||
| 320 | }, | ||
| 321 | 'M' => { 'value' => 30, | ||
| 322 | 'norm' => "D", | ||
| 323 | 'norm2' => '', | ||
| 324 | }, | ||
| 325 | 'Q' => { 'value' => 4, | ||
| 326 | 'norm' => "M", | ||
| 327 | 'norm2' => '', | ||
| 328 | }, | ||
| 329 | 'Y' => { 'value' => 12, | ||
| 330 | 'norm' => "M", | ||
| 331 | 'norm2' => '', | ||
| 332 | }, | ||
| 333 | ); | ||
| 334 | |||
| 335 | if ($value =~ /^RP(?<unit>[^\/]+)\/(?<denum>\d+)/o) { | ||
| 336 | if (exists $correspUnit{$+{unit}}) { | ||
| 337 | # $valnum = sprintf("%0.2f", $correspUnit{$+{unit}}->{'value'} / $correspUnit{$+{denum}}); | ||
| 338 | $valnum = sprintf("%0.2f", $correspUnit{$+{unit}}->{'value'} / $+{denum}); | ||
| 339 | # warn "valnum: $valnum\n"; | ||
| 340 | $value = "RP" . $correspUnit{$+{unit}}->{'norm2'} . $valnum . $correspUnit{$+{unit}}->{'norm'}; | ||
| 341 | } | ||
| 342 | } elsif ($value eq '@NOW@') { | ||
| 343 | # if ($term->start_token->getFrom < ($document->getAnnotations->getTokenLevel->getLastElement->getFrom/2)) { | ||
| 344 | $self->_searchDataFromTheBeginning($term, $document); | ||
| 345 | # } else { | ||
| 346 | # $self->_searchDataFromTheEnd($term, $document); | ||
| 347 | # } | ||
| 348 | push @$undefinedRef, $term; | ||
| 349 | } elsif ($value =~ /SUB(?<unit>[A-Z])/) { | ||
| 350 | # warn "$value" . " : " . $+{unit} . "\n"; | ||
| 351 | $repl = $correspUnit{$+{unit}}->{'norm'}; | ||
| 352 | $value =~ s/SUB[A-Z]/$repl/; | ||
| 353 | # warn "$value\n"; | ||
| 354 | $value =~ s/([A-Z])0([0-9])/$1$2/; | ||
| 355 | # warn "$value\n"; | ||
| 356 | } elsif ($value =~ /(?<unit0>[0-9]+)(?<unit>[A-Z])(?<unit1>[0-9]+)DIV(?<unit2>[0-9]+)/) { | ||
| 357 | $valnum = sprintf("%4.1f", $+{unit0}+($+{unit1} / $+{unit2})); | ||
| 358 | # warn "valnum: $valnum\n"; | ||
| 359 | $value =~ s/(?<unit0>[0-9]+)(?<unit>[A-Z])(?<unit1>[0-9]+)DIV(?<unit2>[0-9]+)/$valnum$+{unit}/; | ||
| 360 | # TO UNCOMMENT AT THE END | ||
| 361 | # } elsif ($value =~ /UNDEF/) { | ||
| 362 | # $value=""; | ||
| 363 | } | ||
| 364 | $$valueRef=$value; | ||
| 365 | # warn "value: $$valueRef\n"; | ||
| 366 | } | ||
| 367 | |||
| 368 | sub _searchDataFromTheBeginning { | ||
| 369 | my ($self, $term, $document) = @_; | ||
| 370 | |||
| 371 | my $currentTerm; | ||
| 372 | my $token; | ||
| 373 | my @terms; | ||
| 374 | my $type; | ||
| 375 | # | ||
| 376 | $token = $document->getAnnotations->getTokenLevel->getFirstElement; | ||
| 377 | while(defined ($token->next)) { | ||
| 378 | if ($document->getAnnotations->getSemanticUnitLevel->existsElementByToken($token)) { | ||
| 379 | @terms = $document->getAnnotations->getSemanticUnitLevel->getElementByToken($token); | ||
| 380 | if ((scalar(@terms) > 0) && | ||
| 381 | (defined $terms[0]->getSemanticFeatureFC($document))) { | ||
| 382 | $type = lc($terms[0]->getSemanticFeatureFC($document)); | ||
| 383 | if (($type eq "date") && ($terms[0]->canonical_form =~ /\d{4}-\d{2}-\d{2}/)) { | ||
| 384 | return($terms[0]->canonical_form); | ||
| 385 | } | ||
| 386 | } | ||
| 387 | } | ||
| 388 | $token = $token->next; | ||
| 389 | } | ||
| 390 | # if (!defined $term->getSemanticFeatureFC($document)) { | ||
| 391 | return(""); | ||
| 392 | } | ||
| 393 | |||
| 394 | # sub _checkTermDate { | ||
| 395 | # my ($self, $term, $document, $token) = @_; | ||
| 396 | |||
| 397 | # my $token; | ||
| 398 | # my @terms; | ||
| 399 | |||
| 400 | # if ($document->getAnnotations->getSemanticUnitLevel->existsElementByToken($token)) { | ||
| 401 | # @terms = $document->getAnnotations->getSemanticUnitLevel->getElementByToken($token); | ||
| 402 | # if ((scalar(@terms) > 0) && | ||
| 403 | # (defined $terms[0]->getSemanticFeatureFC($document))) { | ||
| 404 | # $type = lc($terms[0]->getSemanticFeatureFC($document)); | ||
| 405 | # if (($type eq "date") && ($terms[0]->canonical_form =~ /\d{4}-\d{2}-\d{2}/)) { | ||
| 406 | # return($terms[0]->canonical_form); | ||
| 407 | # } | ||
| 408 | # } | ||
| 409 | # } | ||
| 410 | # } | ||
| 411 | |||
| 412 | sub _searchDataFromTheEnd { | ||
| 413 | my ($self, $term, $document) = @_; | ||
| 414 | |||
| 415 | my $currentTerm; | ||
| 416 | my $token; | ||
| 417 | my @terms; | ||
| 418 | my $type; | ||
| 419 | |||
| 420 | $token = $document->getAnnotations->getTokenLevel->getLastElement; | ||
| 421 | while(defined ($token->previous)) { | ||
| 422 | if ($document->getAnnotations->getSemanticUnitLevel->existsElementByToken($token)) { | ||
| 423 | @terms = $document->getAnnotations->getSemanticUnitLevel->getElementByToken($token); | ||
| 424 | if ((scalar(@terms) > 0) && | ||
| 425 | (defined $terms[0]->getSemanticFeatureFC($document))) { | ||
| 426 | $type = lc($terms[0]->getSemanticFeatureFC($document)); | ||
| 427 | if (($type eq "date") && ($terms[0]->canonical_form =~ /\d{4}-\d{2}-\d{2}/)) { | ||
| 428 | return($terms[0]->canonical_form); | ||
| 429 | } | ||
| 430 | } | ||
| 431 | } | ||
| 432 | $token = $token->next; | ||
| 433 | } | ||
| 434 | # $document->getAnnotations->getTokenLevel->getLastElement | ||
| 435 | return(""); | ||
| 436 | } | ||
| 437 | |||
| 438 | 1; | ||
| 439 | |||
| 440 | |||
| 441 | |||
| 442 | __END__ |