Lingua-YaTeA

 view release on metacpan or  search on metacpan

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

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
    return $this->{ID};
}
 
sub getName
{
    my ($this) = @_;
    return $this->{NAME};
 
}
 
sub update
{
    my ($this,$word) = @_;
    $this->{NAME} = $word->getLexItem->getIF;
}
 
1;
 
__END__
 
=head1 NAME

lib/Lingua/YaTeA/Edge.pm  view on Meta::CPAN

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
        }
        else{
            if ((blessed($this)) && ($this->isa('Lingua::YaTeA::PatternLeaf')))
            {
                return "";
            }
        }
    }
}
 
sub update
{
    my ($this,$new_value) = @_;
    $this = $new_value;
}
 
 
 
sub print
{
    my ($this,$words_a,$fh) = @_;

lib/Lingua/YaTeA/InternalNode.pm  view on Meta::CPAN

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
    my ($this,$father) = @_;
    $this->{FATHER} = $father;
}
 
sub getFather
{
    my ($this) = @_;
    return $this->{FATHER};
}
 
sub updateLevel
{
    my ($this,$new_level) = @_;
    $this->{LEVEL} = $new_level++;
 
#     warn "Debug: Level in updateLevel: $new_level \n";
 
    if ($new_level < 50) { # Temporary added by Thierry Hamon 02/02/2007
        if ((blessed($this->getLeftEdge)) && ($this->getLeftEdge->isa('Lingua::YaTeA::InternalNode')))
        {
            $this->getLeftEdge->updateLevel($new_level);

lib/Lingua/YaTeA/Node.pm  view on Meta::CPAN

1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
    }
    else
    {
        warn "searchLeaf: Going out a deep recursive method call (more than 50 calls)\n";
        return undef;
    }
    #  print STDERR "SL5\n";
    return ($node,$position);
}
 
sub updateLeaves
{
    my ($this,$counter_r,$index_set) = @_;
     
    if ((blessed($this->getLeftEdge)) && ($this->getLeftEdge->isa('Lingua::YaTeA::TermLeaf')))
 
    {
        $this->{LEFT_EDGE} = Lingua::YaTeA::TermLeaf->new($index_set->getIndex($$counter_r++));
    }
    else
    {

lib/Lingua/YaTeA/NodeSet.pm  view on Meta::CPAN

58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
}
 
 
 
sub getNode
{
    my ($this,$index) = @_;
    return $this->getNodes->[$index];
}
 
sub updateRoot
{
    my ($this) = @_;
    my %nodes_id;
    my $node;
    foreach $node (@{$this->getNodes})
    {
        $nodes_id{$node->getID}++;
    }
 
    if(scalar @{$this->getNodes} == 0)

lib/Lingua/YaTeA/NodeSet.pm  view on Meta::CPAN

133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
sub fillNodeLeaves
{
    my ($this,$index_set) = @_;
    my $counter = 0;
   
    $this->getRoot->fillLeaves(\$counter,$index_set, 0);
}
 
 
 
sub updateLeaves
{
    my ($this,$index_set) = @_;
    my $counter = 0;
    $this->getRoot->updateLeaves(\$counter,$index_set);
}
 
sub searchFreeNodes
{
  my ($this,$words_a) = @_;
  my $node;

lib/Lingua/YaTeA/Option.pm  view on Meta::CPAN

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
    return $this->{NAME};
}
 
 
sub getValue
{
    my ($this) = @_;
    return $this->{VALUE};
}
 
sub update
{
    my ($this,$new_value,$message_set,$display_language) = @_;
    my $old_value = $this->getValue;
    $this->{VALUE} = $new_value;
    if(defined $message_set)
    {
        print STDERR "WARNING: " . $this->getName . ": " . $message_set->getMessage('OPTION_VALUE_UPDATE')->getContent($display_language) . "\"" . $new_value . "\" (";
        print STDERR $message_set->getMessage('OLD_OPTION_VALUE')->getContent($display_language) . "\"". $old_value . "\")\n";
    }
}

lib/Lingua/YaTeA/PhraseSet.pm  view on Meta::CPAN

301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
               #            $phrase->printForestParenthesised($fh);
               #  print $fh "\n\n";
               printf STDERR $message_set->getMessage('UNPARSED_PHRASES')->getContent($display_language) . "... %0.1f%%   \r", (scalar(@{$this->getUnparsed}) / $Unparsed_size) * 100 ;
           }
        }
        print STDERR "\n";
    }
     
}
 
sub updateRecord
{
    my ($this,$phrase,$tag_set) = @_;
    my $key;
    my $reference;
     
    $key = $phrase->buildKey;
     
    if(exists $this->getPhrases->{$key})
    {
        delete $this->getPhrases->{$key};

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

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
    my ($class) = @_;
    $in_doc_counter = 0;
}
 
sub resetStartChar
{
    my ($class) = @_;
    $start_char = 0;
}
 
sub updateStartChar
{
    my ($class,$word) = @_;
    $start_char += $word->getLexItem->getLength +1;
}
 
sub getDocument
{
    my ($this) = @_;
    return $this->{DOCUMENT};
}

lib/Lingua/YaTeA/Tree.pm  view on Meta::CPAN

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
    return $this->{SIMPLIFIED_INDEX_SET};
}
 
 
sub getRoot
{
    my ($this) = @_;
    return $this->getNodeSet->getRoot;
}
 
sub updateRoot
{
    my ($this) = @_;
    $this->getNodeSet->updateRoot;
}
 
 
 
 
 
sub setNodeSet

lib/Lingua/YaTeA/Tree.pm  view on Meta::CPAN

752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
            $below = $this->getNodeSet->searchRootNodeForLeaf($pivot);
            if (defined $below) { # Added by Thierry 02/03/2007
                my $context = {"ABOVE"=>$above, "PLACE"=>$place, "BELOW" => $below, "TREE"=>$this, "INDEX_SET"=>$index_set, "ADDED_NODE_SET"=>$added_node_set, "ADDED_INDEX_SET"=>$added_index_set};
                push @contexts, $context;
            }
        }
    }
    return \@contexts;
}
 
sub updateIndexes
{
    my ($this,$phrase_index_set,$words_a) = @_;
    my $heads_h;
    my $index_set = Lingua::YaTeA::IndexSet->new;
    my $simplified_index_set = $phrase_index_set->copy;
    $this->getNodeSet->fillIndexSet($index_set);
     
 
    $heads_h = $this->getNodeSet->searchHeads($words_a);
    if ($simplified_index_set->simplifyWithSeveralPivots($index_set,$this->getNodeSet,$this,$heads_h) == -1 ) {return -1;}

lib/Lingua/YaTeA/WordFromCorpus.pm  view on Meta::CPAN

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
     
    if ($this->getLexItem->getPOS eq $document_boundary)
    {
        return 1;
    }
    return 0;
}
 
 
 
sub updateSentence
{
    my ($this,$sentences) = @_;
    $this->{SENTENCE} = $sentences->getCurrent;
}
 
sub updateStartChar
{
    my ($this) = @_;
    $this->{START_CHAR} = $Lingua::YaTeA::Sentence::start_char;
}
 
sub isChunkingFrontier
{
    my ($this,$chunking_data) = @_;
    my @types = ("POS""LF", "IF");
    my $type;



( run in 0.285 second using v1.01-cache-2.11-cpan-0f795438458 )