Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Treex/Block/Misc/CreateWordToSentenceIndex.pm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ sub process_zone {
my $sentid = scalar(@{$self->_index->{sentences}});
push @{$self->_index->{sentences}}, $zone;

my @nodes = grep { $_->tag =~ /$self->tag_regex/ } $zone->get_atree()->get_descendants();
my @nodes = grep { $_->tag =~ $self->tag_regex } $zone->get_atree()->get_descendants();

foreach my $node (@nodes) {
# if ( length($node->lemma) < $WORD_MIN_LEN || length($node->lemma) > $WORD_MAX_LEN) {
Expand Down
3 changes: 2 additions & 1 deletion lib/Treex/Block/T2TAMR/ApplyRules.pm
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,8 @@ sub copy_subtree {
foreach my $target_tree_node ( $target_node->get_root()->get_descendants() ) {

# for a node with the same rule $query and rule-id corresponding to rule node parents' lemma
if ( $rule_node_parent->t_lemma =~ /{$target_tree_node->wild->{'query_label'}->{$query}}[0]/i ) {
my $regex = $target_tree_node->wild->{'query_label'}{$query}[0];
if ( $rule_node_parent->t_lemma =~ /$regex/i ) {
$target_node->set_parent($target_tree_node);
}
}
Expand Down
Loading