view release on metacpan or search on metacpan
lib/Lingua/YaTeA/Document.pm view on Meta::CPAN
323334353637383940414243444546474849505152
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
333435363738394041424344454647484950515253
}
else
{
if
((blessed(
$this
)) && (
$this
->isa(
'Lingua::YaTeA::PatternLeaf'
)))
{
return
""
;
}
}
}
}
sub
update
{
my
(
$this
,
$new_value
) =
@_
;
$this
=
$new_value
;
}
sub
{
my
(
$this
,
$words_a
,
$fh
) =
@_
;
lib/Lingua/YaTeA/InternalNode.pm view on Meta::CPAN
242526272829303132333435363738394041424344
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
111411151116111711181119112011211122112311241125112611271128112911301131113211331134
}
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
585960616263646566676869707172737475767778}
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
133134135136137138139140141142143144145146147148149150151152153sub
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
202122232425262728293031323334353637383940
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
)
{
STDERR
"WARNING: "
.
$this
->getName .
": "
.
$message_set
->getMessage(
'OPTION_VALUE_UPDATE'
)->getContent(
$display_language
) .
"\""
.
$new_value
.
"\" ("
;
STDERR
$message_set
->getMessage(
'OLD_OPTION_VALUE'
)->getContent(
$display_language
) .
"\""
.
$old_value
.
"\")\n"
;
}
}
lib/Lingua/YaTeA/PhraseSet.pm view on Meta::CPAN
301302303304305306307308309310311312313314315316317318319320321
# $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 ;
}
}
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
242526272829303132333435363738394041424344
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
888990919293949596979899100101102103104105106107108
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
752753754755756757758759760761762763764765766767768769770771772
$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
90919293949596979899100101102103104105106107108109110111112113114115116
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
;