scriptators/perl/sample.pl [51:87]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sub process { my ($tcas, $rs) = @_; if ($main::debug > 10) { print "$main::thisScript: This is a process function\n"; } my $text = $tcas->getDocumentText(); my $index = $tcas->getIndexRepository(); my $annotCount = 0; while ($text =~ m/($main::matchString)/igo) { my $length = length($1); my $end= pos($text); my $fs = $tcas->createAnnotation($main::keywordtype, $end-$length, $end); $index->addFS($fs); $annotCount++; } if ($main::debug > 10) { print "$main::thisScript: created $annotCount annotations\n"; } if ($main::debug > 20) { my $annots = 0; my $iterator = $tcas->getAnnotationIndex($main::keywordtype)->iterator(); while ($iterator->isValid()) { $annots += 1; if ($main::debug > 30) { my $anno = $iterator->get(); my $text = $anno->getCoveredText(); if (length($text)>40) { $text = substr($text,0,20) . "..."; } $text =~ s/\n+/ /g; print "Annotation type=", $main::keywordtype->getName(),": \"$text\"\n"; } $iterator->moveToNext(); } print "$main::thisScript: found $annots annotations\n"; } } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - scriptators/perl/ae.pl [51:87]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sub process { my ($tcas, $rs) = @_; if ($main::debug > 10) { print "$main::thisScript: This is a process function\n"; } my $text = $tcas->getDocumentText(); my $index = $tcas->getIndexRepository(); my $annotCount = 0; while ($text =~ m/($main::matchString)/igo) { my $length = length($1); my $end= pos($text); my $fs = $tcas->createAnnotation($main::keywordtype, $end-$length, $end); $index->addFS($fs); $annotCount++; } if ($main::debug > 10) { print "$main::thisScript: created $annotCount annotations\n"; } if ($main::debug > 20) { my $annots = 0; my $iterator = $tcas->getAnnotationIndex($main::keywordtype)->iterator(); while ($iterator->isValid()) { $annots += 1; if ($main::debug > 30) { my $anno = $iterator->get(); my $text = $anno->getCoveredText(); if (length($text)>40) { $text = substr($text,0,20) . "..."; } $text =~ s/\n+/ /g; print "Annotation type=", $main::keywordtype->getName(),": \"$text\"\n"; } $iterator->moveToNext(); } print "$main::thisScript: found $annots annotations\n"; } } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -