The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Lingua::TreeTagger::Filter::Element - Element of a filter

VERSION

Version 0.01

SYNOPSIS

  use Lingua::TreeTagger::Filter;
  
  # Create a new element object.
  my $element = Lingua::TreeTagger::Filter::Element->new(
      lemma       => 'lemma1',
      original    => 'original1',
      tag         => 'tag1',
      quantifier  => '{1}',
  );
  
  
  # Create a new element object which will match every token(wildcard).
  $element = Lingua::TreeTagger::Filter::Element->new();
      
  # Using the negation with the original attribute -> implies that it will match
  # anything but a token with original1 as original attribute. 
  $element = Lingua::TreeTagger::Filter::Element->new(
      lemma       => 'lemma1',
      original    => '!original1',
      tag         => 'tag1',
  );

Description

This module is part of the Lingua::TreeTagger::Filter distribution. It defines a class of elements which constitute the filters. These elements will be compared with the token element of the taggedtext. This class extends the module Lingua::TreeTagger::Token, see also the related documentation. See also Lingua::TreeTagger::Filter, Lingua::TreeTagger::Filter::Result and Lingua::TreeTagger::Filter::Result::Hit

METHODS

new()

The constructor has only optionnal parameters. If constructor the is called without any parameter, object will be initialized as a all token matching object (wildcard). This constructor is normally called by the method add_element of the module Lingua::TreeTagger::Filter and not directly by the user

For the parameters (tag, original and lemma), if ommited the corresponding attributes will be initialized with the value of "." so it will match any values. These parameters are defined in the mother class Lingua::TreeTagger::Token, please see the related documentation.

For the parameters (tag, original and lemma), you can negate any attribute by adding a "!" in front of it. sample: "tag=!JJ" -> signifies that it will match any non-adjective.

sub_tag

Optionnal , a string containing the expression to be substitued with the tag attribute from the tokens of a Lingua::TreeTagger output.

sub_original

Optionnal a string containing the expression to be substitued with the original attribute from the tokens of a Lingua::TreeTagger output.

sub_lemma

Optionnal, a string containing the expression to be substitued with the lemma attribute from the tokens of a Lingua::TreeTagger output.

quantifier

a string, must respect the syntax of Perl quantifier. samples: +/*/?/{n}/{n,m}

The quantifier defines the number of repetitions of the current element in the filter sequence.

If element_object is not defined and quantifier is omitted, the value of quantifier attribute in the corresponding filter element will be initiated to 1(the correpsonding element must appear exactly one time)

ACCESSORS

tag()

Read-only accessor for the 'tag' attribute of a filter element

original()

Read-only accessor for the 'original' attribute of a filter element

lemma()

Read-only accessor for the 'lemma' attribute of a filter element

get_quantifier()

Read-only accessor for the 'quantifier' attribute of a filter element

sub_tag()

Read-only accessor for the 'sub_tag' attribute of a filter element

sub_original()

Read-only accessor for the 'sub_original' attribute of a filter element

sub_lemma()

Read-only accessor for the 'sub_lemma' attribute of a filter element

DIAGNOSTICS

DEPENDENCIES

This is part of the Lingua::TreeTagger::Filter distribution. It is not intended to be used as an independent module.

This module requires module Moose and was developed using version 1.09. Please report incompatibilities with earlier versions to the author.

BUGS AND LIMITATIONS

There are no known bugs in this module.

Please report problems to Benjamin Gay (Benjamin.Gay@unil.ch)

Patches are welcome.

AUTHOR

Benjamin Gay, <Benjamin.Gay at unil.ch>

LICENSE AND COPYRIGHT

Copyright 2011 Benjamin Gay.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.