Lingua-Ogmios

 view release on metacpan or  search on metacpan

lib/Lingua/Ogmios/Annotations.pm  view on Meta::CPAN

	push @section_starts, \@tmp;
	$section =~ s/<[^>]+>//go;
	# warn "$section\n";
	# warn "\t" . length(Lingua::Ogmios::Annotations::Element->_xmldecode($section)) . "\n";
	$start_position += length(Lingua::Ogmios::Annotations::Element->_xmldecode($section));
	# warn "\t" . $start_position . "\n";
    }

    warn "\n[LOG] Identifying end position of the sections\n";

    @canonicalDocument_sections = split m!</section>|</list>|</item>!, $canonicalDocumentString;

    foreach $section (@canonicalDocument_sections) {
	if ($section eq "") {
	    # warn "empty section content ($end_position)\n";
	    if ($end_position != 0) {
		push @section_ends, $end_position-1;
	    } else {
		push @section_ends, $end_position;
	    }
	} else {

lib/Lingua/Ogmios/NLPWrappers/LexicalSyntacticPatterns.pm  view on Meta::CPAN

	}
    }
    close FILEINPUT;

    warn "[LOG]\n";
}

sub _extractInfos {
    my ($self, $string) = @_;

    my ($IF, $POSTAG, $LM, $ID, $DOCID, $SEMTAG) = split m!/!, $string;
    my $document;
    my $word;
    my $termUnit;

    $document = $self->_documentSet->[$DOCID];
    if ($POSTAG eq "term") {	
	$termUnit = $document->getAnnotations->getSemanticUnitLevel->getElementById($ID);
    } else {
	# creation of term
	$word = $document->getAnnotations->getWordLevel->getElementById($ID);

lib/Lingua/Ogmios/NLPWrappers/Wrapper.pm  view on Meta::CPAN

# 	    print "i = $i (" . $pattern->[$i]->{'type'} . ")\n";
 		$found = 0;
 		last;
	    }
	}
    }
#      print STDERR "($level - $found)\n";
    if (($level == 0) && ($found == 1)) { # ($i == scalar(@$pattern)) {
#      if ($found == 1) { # ($i == scalar(@$pattern)) {
#     	print STDERR "PATTERN FOUND ($level - $found) - " .  $synPattern->{"action"} . "\n";
#	my @tmp = split m!/!, $synPattern->{"action"};
	&$function_pointer($document, $synPattern->{"action"}, $terms, $args);
# 	&$function_pointer($document, $synPattern->{"action"}, \@terms, $args);
    }
    return($found);
}

sub _searchSynDep {
    my ($self, $document, $start_token, $end_token, $syndep, $WindowSize, $patternElements, $terms) = @_;

    my $token = $start_token;



( run in 2.369 seconds using v1.01-cache-2.11-cpan-71847e10f99 )