Created
December 15, 2014 07:52
-
-
Save kogecoo/591fbf8eaab9cecf57cc to your computer and use it in GitHub Desktop.
A patch for SynCha 0.3.1 to be perl-5.14 or later compatible.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git src/event-noun.pl src/event-noun.pl | |
index 48c431f..3b8ae3b 100644 | |
--- src/event-noun.pl | |
+++ src/event-noun.pl | |
@@ -32,22 +32,22 @@ sub new { | |
# (skip now. consider later) | |
# argument-identification model (in the same bunsetsul) | |
- for my $TYPE qw(ga o ni) { | |
+ for my $TYPE (qw(ga o ni)) { | |
$self->{'arg_in_b_model_'.$TYPE} = MegamBinary->new($path.'/dat/model/noun_soon_in_b_'.$TYPE.'/model_0.megam'); | |
} | |
# argument-identification model (intra-sentential) | |
- for my $TYPE qw(ga o ni) { | |
+ for my $TYPE (qw(ga o ni)) { | |
$self->{'arg_intra_model_'.$TYPE} = MegamBinary->new($path.'/dat/model/noun_soon_intra_'.$TYPE.'/model_0.megam'); | |
} | |
# argument-identification model (inter-sentential) | |
- for my $TYPE qw(ga o ni) { | |
+ for my $TYPE (qw(ga o ni)) { | |
$self->{'arg_inter_model_'.$TYPE} = MegamBinary->new($path.'/dat/model/noun_soon_inter_'.$TYPE.'/model_0.megam'); | |
} | |
# anaphoricity-determination model (event-noun) | |
- for my $TYPE qw(ga o ni) { | |
+ for my $TYPE (qw(ga o ni)) { | |
$self->{'arg_ad_model_'.$TYPE} = MegamBinary->new($path.'/dat/model/noun_ana_scm_'.$TYPE.'/model_0.megam'); | |
} | |
@@ -150,7 +150,7 @@ sub _detect_args_noun { | |
my @c = &_ext_candidate_noun($sent, $bunsetsu, $mid, \@cand); | |
my %type2elm = (); | |
for my $c (@c) { | |
- for my $TYPE qw(ga o ni) { | |
+ for my $TYPE (qw(ga o ni)) { | |
my $fe = &_ext_fe_args_noun($en, $bunsetsu, $c, \@bunsetsu, $sent_ref, $cl, $self->{ncv_model}, $TYPE); | |
my $score; | |
if ($bunsetsu->sid == $c->sid) { | |
diff --git src/predicate.pl src/predicate.pl | |
index 97ee822..e5daec3 100644 | |
--- src/predicate.pl | |
+++ src/predicate.pl | |
@@ -32,27 +32,27 @@ sub new { | |
# (skip now. consider later) | |
# argument-identification model (dependants) | |
- for my $TYPE qw(ga o ni) { | |
+ for my $TYPE (qw(ga o ni)) { | |
$self->{'arg_depend_model_'.$TYPE} = MegamBinary->new($path.'/dat/model/dep_soon_'.$TYPE.'/model_0.megam'); | |
} | |
# argument-identification model (adnominal clause) | |
- for my $TYPE qw(ga o ni) { | |
+ for my $TYPE (qw(ga o ni)) { | |
$self->{'arg_adnom_model_'.$TYPE} = MegamBinary->new($path.'/dat/model/adnom_soon_'.$TYPE.'/model_0.megam'); | |
} | |
# argument-identification model (intra-sentential zero-anaphora) | |
- for my $TYPE qw(ga o ni) { | |
+ for my $TYPE (qw(ga o ni)) { | |
$self->{'arg_intra_model_'.$TYPE} = MegamBinary->new($path.'/dat/model/zero_soon_intra_'.$TYPE.'/model_0.megam'); | |
} | |
# argument-identification model (inter-sentential zero-anaphora) | |
- for my $TYPE qw(ga o ni) { | |
+ for my $TYPE (qw(ga o ni)) { | |
$self->{'arg_inter_model_'.$TYPE} = MegamBinary->new($path.'/dat/model/zero_soon_inter_'.$TYPE.'/model_0.megam'); | |
} | |
# anaphoricity-determination model (zero-anaphora) | |
- for my $TYPE qw(ga o ni) { | |
+ for my $TYPE (qw(ga o ni)) { | |
$self->{'arg_ad_model_'.$TYPE} = MegamBinary->new($path.'/dat/model/zero_ana_scm_'.$TYPE.'/model_0.megam'); | |
} | |
@@ -142,7 +142,7 @@ sub _detect_args_dependants { | |
if ($pred->is_pred) { | |
my @cand = &_ext_candidate_dependants($pred->id, \@bunsetsu); | |
for my $cand (@cand) { | |
- for my $TYPE qw(ga o ni) { | |
+ for my $TYPE (qw(ga o ni)) { | |
my $score = $self->{'arg_depend_model_'.$TYPE}->predict(&_ext_fe_arg_dependants($pred, $cand, \@bunsetsu, $sent_ref, $cl, $self->{'ncv_model'}, $TYPE)); | |
my $elm; | |
$elm->{val} = 'w'.$pred->sid.'/'.$pred->id.'_'.$cand->sid.'/'.$cand->id.'_'.$TYPE; | |
@@ -184,7 +184,7 @@ sub _detect_args_adnom { | |
next unless ($pred->is_pred); | |
my $cand = &_ext_candidate_adnom($pred->id, $sent); | |
next unless $cand; | |
- for my $TYPE qw(ga o ni) { | |
+ for my $TYPE (qw(ga o ni)) { | |
my $score = $self->{'arg_adnom_model_'.$TYPE}->predict(&_ext_fe_arg_adnom($pred, $cand, \@bunsetsu, $sent_ref, $cl, $self->{'ncv_model'}, $TYPE)); | |
# print STDERR $score."\n"; | |
my $elm; | |
@@ -228,7 +228,7 @@ sub _detect_args_zero { | |
my @c = &_ext_candidate_zero($sent, $pred, \@cand); | |
my %type2elm = (); | |
for my $c (@c) { | |
- for my $TYPE qw(ga o ni) { | |
+ for my $TYPE (qw(ga o ni)) { | |
# print STDERR "check3-1\n"; | |
my $fe = &_ext_fe_args_zero($pred, $c, \@bunsetsu, $sent_ref, $cl, $self->{'ncv_model'}, $TYPE); | |
my $score; |
Author
kogecoo
commented
Dec 15, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment