Commit cb62331a authored by Vladislav Perepelkin's avatar Vladislav Perepelkin
Browse files

fixed error message bug

parent f4b28fe3
5 10 16
5 0.6 0.2 0.2
10 0.2 0.6 0.2
10 0.6 0.2 0.2
16 0.2 0.2 0.6
......@@ -25,7 +25,7 @@ def error(message):
print
print "ERROR", message
print
sys.exit()
sys.exit(1)
def extract_words(line):
return filter(lambda x: x.strip(),
......@@ -100,8 +100,8 @@ while i<len(lines):
for s0 in range(256):
sum_prob=reduce(lambda x, y: x+y, [rules[s0][s1] for s1 in rules[s0]])
if sum_prob!=1:
error("Normalization fails for state (" + s0 + "), sum prob is "
+ str(sum_prob))
error("Normalization fails for state (" + str(s0) +\
"), sum prob is " + str(sum_prob))
# generate code
try:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment