feat(transforms): remove ability words

This commit is contained in:
Sabe Jones 2017-01-17 19:28:53 +00:00
parent 65905cf656
commit 68704c0094
2 changed files with 46 additions and 0 deletions

View file

@ -298,6 +298,7 @@ def fields_from_json(src_json, linetrans = True):
text_val = transforms.text_pass_3_unary(text_val)
text_val = transforms.text_pass_4a_dashes(text_val)
text_val = transforms.text_pass_4b_x(text_val)
text_val = transforms.text_pass_4c_abilitywords(text_val)
text_val = transforms.text_pass_5_counters(text_val)
text_val = transforms.text_pass_6_uncast(text_val)
text_val = transforms.text_pass_7_choice(text_val)

View file

@ -158,6 +158,51 @@ def text_pass_4b_x(s):
return s
def text_pass_4c_abilitywords(s):
# Ability words are flavor text. We can discard them
abilitywords = [
'battalion',
'bloodrush',
'channel',
'chroma',
'cohort',
'constellation',
'converge',
"council's dilemma",
'delirium',
'domain',
'fateful hour',
'ferocious',
'formidable',
'grandeur',
'hellbent',
'heroic',
'imprint',
'inspired',
'join forces',
'kinship',
'landfall',
'lieutenant',
'metalcraft',
'morbid',
'parley',
'radiance',
'raid',
'rally',
'spell mastery',
'strive',
'sweep',
'tempting offer',
'threshold',
'will of the council',
]
for abilityword in abilitywords:
s = s.replace(abilityword + ' ' + u'\u2014' + ' ', '')
return s
# Call this before replacing newlines.
# This one ends up being really bad because of the confusion
# with 'counter target spell or ability'.