summaryrefslogtreecommitdiffstats
path: root/scripts/genspecialtable.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/genspecialtable.py')
-rw-r--r--scripts/genspecialtable.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/genspecialtable.py b/scripts/genspecialtable.py
index a53be7a..c7384b5 100644
--- a/scripts/genspecialtable.py
+++ b/scripts/genspecialtable.py
@@ -68,9 +68,17 @@ def gen_resplit_table():
(orig_first_key, orig_second_key, new_first_key, new_second_key) = map\
(get_chewing_string, (orig_first_key, orig_second_key, \
new_first_key, new_second_key))
- entry = '{{{0}, {1}, {2}, {3}, {4}, {5}}}'.format \
- (orig_first_key, orig_second_key, orig_freq, \
- new_first_key, new_second_key, new_freq)
+ if new_freq > orig_freq:
+ if orig_freq == 0:
+ benefit = 0.5
+ else:
+ benefit = 0.3
+ elif orig_freq >= new_freq:
+ assert orig_freq > 0, "Expected orig_freq > 0 here."
+ benefit = 0
+ entry = '{{{0}, {1}, {2}, {3}, {4}}}'.format \
+ (orig_first_key, orig_second_key, \
+ new_first_key, new_second_key, benefit)
entries.append(entry)
return ',\n'.join(entries)