Created
May 24, 2012 03:06
-
-
Save tabris2012/2779209 to your computer and use it in GitHub Desktop.
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
for ($i =1; $i < @$lineList; $i++) { | |
if (${$trans[$state[$i -1]]}[$state[$i]] <0.4) { #遷移確率が低かったら修正 | |
if ($pk[$state[$i -1]] <0.4) { #遷移前の出現確率も低かったら修正 | |
for ($j =0; $j < @{$vector[$i]}; $j++) { | |
if ((${$vector[$i]}[$j]) && ($j != $stateAttr[$state[$i -1]] -1)) { | |
push @estAttr, $j +1; | |
last; | |
} | |
} | |
if ($j == @{$vector[$i]}) { | |
push @estAttr, $stateAttr[$state[$i -1]]; | |
} | |
} | |
else { #遷移させなかった場合の状態からの属性を採用 | |
push @estAttr, $stateAttr[$state[$i -1]]; | |
} | |
} | |
elsif ($pk[$state[$i]] <0.4) { #出現確率が低かったら修正 | |
for ($j =0; $j < @{$vector[$i]}; $j++) { | |
if ((${$vector[$i]}[$j]) && ($j != $stateAttr[$state[$i]] -1)) { | |
push @estAttr, $j +1; | |
last; | |
} | |
} | |
if ($j == @{$vector[$i]}) { | |
push @estAttr, $stateAttr[$state[$i]]; | |
} | |
} | |
else { | |
push @estAttr, $stateAttr[$state[$i]]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment