Lingua-FreeLing3

 view release on metacpan or  search on metacpan

lib/Lingua/FreeLing3/ChartParser.pm  view on Meta::CPAN


    my $config = Lingua::FreeLing3::Config->new($lang);
    my $file = $config->config("GrammarFile");

    unless (-f $file) {
        carp "Cannot find chart tagger data file. Tried [$file]\n";
        return undef;
    }

    my $self = $class->SUPER::new($file);
    return bless $self => $class
}

=head2 C<parse>

Alias to C<analyze>.

=cut

sub parse { &analyze }

lib/Lingua/FreeLing3/Config.pm  view on Meta::CPAN


        if (/^([^= ]+)\s*=\s*(.*)/) {
            my ($key, $value) = ($1, $2);
            $value =~ s/\$FREELINGSHARE/$prefix/;
            $config->{$key} = $value;
        }
    }

    close $fh;

    return bless $config => $class;
}

sub config {
    my ($self, $key) = @_;
    if (exists($self->{$key})) {
	return $self->{$key}
    } else {
	use Data::Dumper;
	die "Queried for $key on a config file the doesn't include it\n", Dumper($self);
    }

lib/Lingua/FreeLing3/DepTree.pm  view on Meta::CPAN


   $ptree = $sentence->dep_tree;


=head1 DESCRIPTION

=cut

sub _new_from_binding {
    my ($class, $word) = @_;
    return bless $word => $class #amen
}

=head2 ACCESSORS

=over 4

=item C<num_children>

Returns the number of childs for this tree node.

lib/Lingua/FreeLing3/DepTxala.pm  view on Meta::CPAN


    my $config = Lingua::FreeLing3::Config->new($lang);
    my $file = $config->config("DepTxalaFile");

    unless (-f $file) {
        carp "Cannot find txala data file. Tried [$file]\n";
        return undef;
    }

    my $self = Lingua::FreeLing3::Bindings::dep_txala->new($file, $start_symbol);
    return bless $self => $class #amen
}


=head2 C<parse>

Alias to C<analyze>.

=cut

sub parse { &analyze }

lib/Lingua/FreeLing3/Dictionary.pm  view on Meta::CPAN

    }

    my $file = $config->config('DictionaryFile');

    unless (-f $file) {
        carp "Cannot find dictionary data file. Tried [$file]\n";
        return undef;
    }

    my $self = $class->SUPER::new($lang, $file, $affix, $affixFile, $inverse, $retok);
    return bless $self => $class
}

=head2 C<get_forms>

Returns a list of possible derivative forms from a specific word, and
a Part-Of-Speech tag.

 $forms = $dict->get_forms('carro', 'NCMP000');

=cut

lib/Lingua/FreeLing3/Document.pm  view on Meta::CPAN


=head2 C<new>

The constructor returns a new Document object.

=cut

sub new {
    my $class = shift;
    my $self = $class->SUPER::new();
    return bless $self => $class #amen
}

=head2 C<push>

Adds a paragraph to the end of the document.

=cut

sub push {
    my $self = shift;

lib/Lingua/FreeLing3/HMMTagger.pm  view on Meta::CPAN

    my $kbest = $ops{KBest} || 1;

    my $self;

    if (Lingua::FreeLing3::ConfigData->config("fl_minor") == 0) {
        $self = $class->SUPER::new($lang, $file, $retok, $amb);
    } else {
        $self = $class->SUPER::new($file, $retok, $amb, $kbest);
    }

    return bless $self => $class
}


=head2 C<tag>

Alias to C<analyze>

=cut

sub tag { &analyze }

lib/Lingua/FreeLing3/NEC.pm  view on Meta::CPAN


    my $config = Lingua::FreeLing3::Config->new($lang);
    my $file = $config->config("NECFile");

    unless (-f $file) {
        carp "Cannot find NEC data file. Tried [$file]\n";
        return undef;
    }

    my $self = $class->SUPER::new($file);
    return bless $self => $class
}


=head2 C<analyze>

Receives a list of sentences, and returns that same list of sentences
with classified entities.

=cut

lib/Lingua/FreeLing3/Paragraph.pm  view on Meta::CPAN


=head2 C<new>

The constructor returns a new Paragraph object: a list of sentences

=cut

sub new {
    my $class = shift;
    my $self = $class->SUPER::new();
    return bless $self => $class #amen
}

sub _new_from_binding {
    my ($class, $paragraph) = @_;
    bless $paragraph => $class #amen
}

=head2 C<push>

Adds one or more sentences to the paragraph.

=cut

sub push {
    my $self = shift;

lib/Lingua/FreeLing3/ParseTree.pm  view on Meta::CPAN


   $node_info = $ptree->info;


=head1 DESCRIPTION

=cut

sub _new_from_binding {
    my ($class, $word) = @_;
    return bless $word => $class #amen
}

=head2 ACCESSORS

=over 4

=item C<word>

Returns the word in that parse tree node, if any.

lib/Lingua/FreeLing3/RelaxTagger.pm  view on Meta::CPAN

    my $ambiguityRes  = Lingua::FreeLing3::_validate_option( $ops{ambiguityResolution},
                                                             {
                                                              FORCE_NONE   => 0,
                                                              FORCE_TAGGER => 1,
                                                              FORCE_RETOK  => 2,
                                                             }, $ft);


    my $self = $class->SUPER::new($file, $maxIterations, $scaleFactor, $threshold,
                                  $retokenize, $ambiguityRes);
    return bless $self => $class
}


=head2 C<tag>

Alias to C<analyze>.

=cut

sub tag { &analyze }

lib/Lingua/FreeLing3/Sentence.pm  view on Meta::CPAN

    my $self = $class->SUPER::new( [ map {
        if (blessed($_) && $_->isa('Lingua::FreeLing3::Bindings::word')) {
            $_
        } elsif (not ref) {
            Lingua::FreeLing3::Word->new($_);
        } else {
            die "Invalid parameter on Sentence constructor: $_"
        }
    } @_ ] );

    return bless $self => $class #amen
}

sub _new_from_binding {
    my ($class, $sentence) = @_;
    return bless $sentence => $class #amen
}

=head2 C<length>

Returns the sentence length (number of words/tokens).

=cut

sub length { $_[0]->SUPER::size }

lib/Lingua/FreeLing3/Splitter.pm  view on Meta::CPAN


    my $config = Lingua::FreeLing3::Config->new($lang);
    my $file = $config->config('SplitterFile');

    unless (-f $file) {
        carp "Cannot find splitter data file. Tried [$file]\n";
        return undef;
    }

    my $self = $class->SUPER::new($file);
    return bless $self => $class
}

=head2 C<split>

This is the only available method for the splitter object. It receives
a list of L<Lingua::FreeLing3::Word> objects (you can obtain one using
the L<Lingua::FreeLing3::Tokenizer>), and splits the text to a list of
sentences.

Without any further configuration option, it will return a reference

lib/Lingua/FreeLing3/Word.pm  view on Meta::CPAN

The C<new> constructor returns a new C<Lingua::FreeLing3::Word>
object. If a parameter is passed, it is interpreted as the word form,
and it is automatically set. Otherwise, an empty word object is
returned.

=cut

sub new {
    my $class = shift;
    my $word = $class->SUPER::new(@_);
    return bless $word => $class #amen
}

sub _new_from_binding {
    my ($class, $word) = @_;
    return bless $word => $class #amen
}

=head2 C<as_hash>

Returns a reference to a hash with the form, lemma and tag (POS) of
the word.

=cut

sub as_hash {

lib/Lingua/FreeLing3/Word/Analysis.pm  view on Meta::CPAN

At the present moment there is one only (empty) constructor. Returns
an C<Lingua::FreeLing3::Word::Analysis> object.

=back

=cut

sub new {
    my $class = shift;
    my $self = $class->SUPER::new();
    return bless $self => $class #amen
}

sub _new_from_binding {
    my ($class, $analysis) = @_;
    return bless $analysis => $class #amen
}

=head2 ACESSORS

These methods let you query an Analysis object:

=over 4

=item C<as_hash>

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.291 second using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )