Alvis-QueryFilter

 view release on metacpan or  search on metacpan

bin/run_QF.pl  view on Meta::CPAN

  s/ $//g;
  return $_;
}

sub checkdict() {
  my $f = shift();
  my $canonise = shift();
  my %dict = ();
  my %line = ();

  if (!defined(open(F,"<:utf8",$f)))
    {
      return undef;
    }

  while (my $l=<F>)
    {
      chomp $l;
      my ($form,$can)=split(/\t/,$l,-1);
      $form = &cleanspaces($form);
      $can = &cleanspaces($can);

lib/Alvis/QueryFilter.pm  view on Meta::CPAN

  return $_;
}

sub _read_lemma_dict
{
    my $self=shift;
    my $f=shift;

    my %dict=();

    if (!defined(open(F,"<:utf8",$f)))
    {
	return undef;
    }

    while (my $l=<F>)
    {
	chomp $l;
	my ($form,$lemma,$pos)=split(/\t/,$l,-1);
	$form = &cleanspaces($form);
	$dict{lc($form)}{lemma}=&cleanspaces($lemma);

lib/Alvis/QueryFilter.pm  view on Meta::CPAN

}

sub _read_term_dict
{
    my $self=shift;
    my $f=shift;

    my %dict=();
    my $term_max_len = 0;

    if (!defined(open(F,"<:utf8",$f)))
    {
	return undef;
    }

    while (my $l=<F>)
    {
	chomp $l;
	my ($form,$can)=split(/\t/,$l,-1);
	$form = &cleanspaces($form);
	$can = &cleanspaces($can);

lib/Alvis/QueryFilter.pm  view on Meta::CPAN

}

sub _read_NE_dict
{
    my $self=shift;
    my $f=shift;

    my %dict=();
    my $term_max_len = 0;

    if (!defined(open(F,"<:utf8",$f)))
    {
	return undef;
    }

    while (my $l=<F>)
    {
	chomp $l;
	my ($form,$can)=split(/\t/,$l,-1);
	$form = &cleanspaces($form);
	$can = &cleanspaces($can);

lib/Alvis/QueryFilter.pm  view on Meta::CPAN

    return \%dict;
}

sub _read_typing_rules
{
    my $self=shift;
    my $f=shift;

    my %dict=();

    if (!defined(open(F,"<:utf8",$f)))
    {
	return undef;
    }

    while (my $l=<F>)
    {
	chomp $l;
	my ($form,$type)=split(/\t/,$l,-1);
	$form = &cleanspaces($form);
	$type = &cleanspaces($type);

lib/Alvis/QueryFilter.pm  view on Meta::CPAN

    return \%dict;
}

sub _read_onto_nodes
{
    my $self=shift;
    my $f=shift;

    my %dict=();

    if (!defined(open(F,"<:utf8",$f)))
    {
	return undef;
    }

    while (my $l=<F>)
    {
	chomp $l;
	my ($form,$onto_node)=split(/\t/,$l,-1);
	$form = &cleanspaces($form);
	$onto_node = &cleanspaces($onto_node);	

lib/Alvis/QueryFilter.pm  view on Meta::CPAN

    return \%dict;
}

sub _read_onto_mapping
{
    my $self=shift;
    my $f=shift;

    my %dict=();

    if (!defined(open(F,"<:utf8",$f)))
    {
	return undef;
    }

    while (my $l=<F>)
    {
	chomp $l;
	my ($node,$path)=split(/\t/,$l,-1);
	$node = &cleanspaces($node);
	$path = &cleanspaces($path);

lib/Alvis/Treetagger.pm  view on Meta::CPAN

package Alvis::Treetagger;

#  must hardwire the root directory for Treetagger below
#  error handling somewhat haphazard, and no auto restart
#  of treetagger if it shutsdown

$Alvis::Treetagger::VERSION = '0.1';

use strict;
use warnings;
use encoding 'utf8';
use open ':utf8';
binmode STDERR, ":utf8";

our $commandLine;
our $taggerRoot;
our $FIFO;
our $parFile;
our $errorFile;
our $verbose;

my $tagpid;



( run in 1.437 second using v1.01-cache-2.11-cpan-5837b0d9d2c )