diff --git a/lib/cardlib.py b/lib/cardlib.py index a5df0e3..118eaaa 100644 --- a/lib/cardlib.py +++ b/lib/cardlib.py @@ -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) diff --git a/lib/transforms.py b/lib/transforms.py index c3036a8..6318b0f 100644 --- a/lib/transforms.py +++ b/lib/transforms.py @@ -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'.