diff --git a/mtg_dictionary.py b/mtg_dictionary.py index 13f6513..02ec3c6 100644 --- a/mtg_dictionary.py +++ b/mtg_dictionary.py @@ -31,7 +31,21 @@ def word_list(card): return words +def keyword_list(card): + if 'booster' not in card or card['booster'] is False: + return [] + if 'type_line' not in card: + return [] + if card['set_type'] in ['funny', 'vanguard', 'memorabilia']: + return [] + if 'oracle_text' not in card: + return [] + if 'keywords' not in card: + return [] + return card['keywords'] + d = {} +k = {} for card in data: if 'oracle_text' in card: card_words = word_list(card) @@ -40,11 +54,26 @@ for card in data: d[word] = 1 else: d[word] += 1 + card_keywords = keyword_list(card) + for keyword in card_keywords: + if keyword not in k: + k[keyword] = 1 + else: + k[keyword] += 1 + + + f_oracle_cards.close() output = open('mtgdict.csv', "w+", encoding='utf8') +output.write('word,frequency\n') for word in d: output.write(f"{word},{d[word]}\n") output.close() +k_output = open('mtgkeywords.csv', 'w+', encoding='utf8') +k_output.write('keyword,frequency\n') +for keyword in k: + k_output.write(f"{keyword},{k[keyword]}\n") +k_output.close() diff --git a/mtgdict.csv b/mtgdict.csv new file mode 100644 index 0000000..c97d1df --- /dev/null +++ b/mtgdict.csv @@ -0,0 +1,1059 @@ +word,frequency +long,839 +as,2528 +is,1692 +untapped,252 +players,136 +can't,1978 +untap,892 +more,833 +than,450 +two,1386 +permanents,342 +during,566 +their,1120 +steps,69 +creature,12686 +gets,2445 +be,1843 +blocked,1203 +except,363 +by,955 +creatures,2632 +with,3364 +flying,997 +or,4262 +reach,123 +loses,485 +your,7301 +choice,229 +of,9737 +first,474 +strike,598 +trample,391 +until,3197 +end,3755 +turn,5086 +all,1149 +multicolored,40 +deals,2380 +damage,3587 +to,7073 +any,1942 +target,5829 +equal,776 +the,11514 +highest,32 +converted,531 +mana,1696 +cost,1866 +among,385 +you,10014 +control,4777 +ability,687 +costs,281 +less,593 +activate,120 +for,2489 +each,2630 +instant,391 +and,4034 +sorcery,617 +card,6120 +in,1441 +graveyard,1999 +this,5663 +has,1240 +no,377 +counters,1214 +on,3392 +it,5440 +put,2398 +four,329 +an,2490 +opponent,1291 +may,3343 +draw,840 +a,11512 +tokens,312 +artifacts,189 +artifact,1245 +one,1150 +color,719 +three,722 +enters,3118 +battlefield,4603 +up,812 +seven,183 +lands,343 +its,2501 +owner's,821 +hand,2309 +from,3021 +top,1037 +library,2367 +only,871 +before,153 +attackers,55 +are,576 +declared,51 +if,1483 +cast,2830 +blue,306 +black,576 +spell,2637 +countered,98 +gain,1266 +hexproof,95 +they,343 +targets,253 +spells,516 +abilities,439 +opponents,291 +exile,829 +opponent's,155 +horsemanship,41 +that's,157 +attached,145 +permanent,983 +another,691 +can,608 +enchant,58 +attacks,675 +isn't,156 +combat,1036 +defending,345 +player,3099 +controls,793 +that,3987 +dies,620 +way,431 +create,599 +token,929 +power,881 +creature's,361 +toughness,376 +reveal,493 +into,1151 +shuffle,498 +counter,2166 +get,796 +pay,973 +additional,475 +was,337 +kicked,166 +discard,384 +do,757 +dealt,733 +leaves,179 +basic,199 +land,1341 +type,351 +tapped,606 +becomes,821 +base,77 +lifelink,177 +five,144 +onto,533 +then,1023 +deal,281 +excess,51 +planeswalker,422 +it's,557 +attacking,440 +sacrifice,816 +addition,132 +other,669 +also,95 +return,672 +enchantment,406 +reveals,196 +discards,369 +cards,2418 +sacrificed,106 +colors,70 +have,832 +where,392 +number,1018 +cycle,57 +charge,177 +beginning,1634 +precombat,11 +main,39 +phase,74 +remove,252 +removed,99 +attacked,81 +under,723 +at,901 +next,822 +step,857 +discarded,34 +lose,286 +life,2030 +legendary,121 +gains,1082 +fear,38 +and/or,240 +look,137 +them,491 +rest,283 +bottom,313 +order,235 +source,135 +would,762 +noncombat,12 +many,143 +instead,493 +controlled,48 +left,21 +green,488 +greater,220 +search,189 +named,169 +paid,136 +either,77 +destroy,488 +fights,50 +enchanted,484 +intimidate,16 +share,65 +choose,543 +controller,573 +adds,27 +chosen,272 +don't,304 +nonblack,66 +vigilance,236 +times,36 +unless,644 +pays,228 +time,724 +face,512 +down,254 +upkeep,1328 +own,105 +exiled,232 +haste,517 +still,109 +you've,56 +gained,16 +block,578 +red,391 +indestructible,137 +plus,94 +divided,49 +enchantments,58 +destroyed,64 +nontoken,105 +copy,322 +symbol,26 +turn's,65 +exiles,81 +putting,29 +whenever,23 +blocks,254 +scry,91 +white,535 +alone,56 +effect,99 +creates,64 +twice,51 +those,284 +puts,110 +intervention,3 +last,133 +game,198 +able,198 +much,186 +menace,77 +nonland,258 +name,276 +flashback,95 +without,395 +paying,237 +bestow,29 +again,36 +not,156 +renowned,42 +s,184 +noncreature,161 +random,186 +owner,28 +colorless,282 +friend,10 +foe,10 +searches,7 +shuffles,118 +sacrifices,223 +protection,163 +equipped,102 +taps,22 +produced,14 +add,124 +could,227 +spell's,146 +draws,138 +amass,12 +most,53 +common,20 +tied,46 +casts,157 +copies,35 +enter,84 +attack,507 +died,47 +blocking,306 +being,88 +minus,23 +verse,22 +owners,85 +hands,76 +age,185 +prevent,124 +spent,107 +both,118 +six,48 +types,172 +snow,93 +move,20 +remains,67 +manifest,12 +shroud,75 +permanent's,21 +does,57 +new,99 +postcombat,2 +there's,3 +followed,4 +resolves,66 +madness,35 +entered,18 +returns,51 +defender,96 +same,153 +tap,345 +form,128 +poison,82 +evoke,13 +when,54 +escape,24 +overload,14 +change,37 +text,29 +replacing,26 +instances,29 +win,95 +clashing,25 +wins,28 +had,141 +higher,26 +double,93 +least,102 +starting,33 +total,158 +rather,107 +chooses,85 +sources,29 +regenerates,5 +single,29 +persist,4 +while,88 +casting,71 +emerge,11 +team,12 +mill,57 +milled,13 +nonblue,3 +regenerated,126 +revealed,139 +itself,16 +flip,122 +coin,67 +whose,12 +comes,30 +tails,5 +kicker,22 +doesn't,307 +controller's,163 +there,167 +mills,155 +council,9 +votes,36 +grace,2 +condemnation,2 +vote,21 +flanking,42 +storage,37 +example,12 +colored,10 +symbols,12 +hasn't,7 +been,41 +die,43 +forestwalk,26 +devotion,93 +unblocked,22 +attacker,7 +deathtouch,123 +amount,113 +enough,60 +represents,39 +suspended,17 +player's,293 +energy,71 +exert,26 +exerted,25 +won't,31 +landcycling,4 +who,57 +didn't,76 +once,83 +tribute,11 +wasn't,19 +megamorph,26 +though,158 +word,11 +lasts,50 +indefinitely,49 +controllers,31 +causes,95 +third,22 +resolved,4 +attach,58 +some,1 +turned,64 +assign,15 +become,68 +assigns,35 +twenty,10 +fewer,30 +declare,27 +discarding,23 +kind,38 +were,46 +noted,12 +owns,17 +silver,2 +combination,18 +fuse,12 +dash,17 +returned,27 +but,26 +planeswalker's,15 +loyalty,36 +activates,9 +unspent,12 +lost,46 +ten,59 +city's,46 +blessing,46 +cycles,6 +play,127 +different,32 +names,19 +exactly,20 +back,50 +islandwalk,20 +spore,37 +help,58 +entwine,24 +agenda,15 +conspiracy,40 +command,28 +zone,28 +secretly,15 +shadow,77 +party,62 +consists,27 +monstrous,64 +leave,25 +graveyards,77 +anywhere,49 +remain,31 +unchanged,6 +lesser,20 +commander's,2 +identity,2 +mutate,63 +over,32 +mutates,29 +mastery,15 +nonbasic,39 +equip,6 +so,26 +shares,48 +come,7 +played,9 +odd,6 +even,15 +value,7 +support,5 +skips,14 +rebound,2 +came,49 +since,55 +echo,51 +morph,133 +longer,5 +level,22 +fade,45 +proliferate,18 +give,28 +already,30 +escapes,10 +opening,20 +plays,9 +soul,3 +targeted,33 +anything,18 +explores,20 +repeat,17 +process,29 +planeswalkers,27 +activated,131 +emblem,50 +fight,16 +slime,3 +weren't,15 +piles,21 +pile,27 +every,38 +tribal,5 +triggered,12 +card's,120 +turns,24 +second,32 +stack,20 +aren't,25 +cause,51 +mining,3 +leaving,1 +land's,17 +music,2 +hunger,2 +begin,15 +skip,19 +monarch,28 +spectacle,12 +clash,17 +won,4 +triggers,13 +after,114 +ends,6 +fungus,7 +twelve,3 +deck,35 +wither,9 +meld,4 +flood,3 +takes,6 +extra,40 +monocolored,7 +historic,45 +legendaries,23 +upkeeps,7 +epic,5 +lore,31 +banding,100 +band,42 +group,42 +divides,8 +paired,36 +you're,37 +done,14 +activating,17 +quest,32 +swampwalk,19 +phases,65 +prevented,46 +reduces,12 +matrix,2 +weapon,8 +they're,18 +separate,4 +treasure,2 +pair,18 +retrace,2 +depletion,35 +effects,79 +say,51 +nonartifact,26 +continuously,6 +recent,1 +first-strike,24 +regular,24 +full,6 +pain,4 +soon,24 +draft,43 +pool,5 +offer,2 +exchange,15 +accept,1 +switch,4 +encoded,22 +landwalk,16 +flash,43 +miracle,7 +drew,11 +out,72 +phased,31 +treated,31 +exist,32 +outside,24 +nonenchantment,4 +half,48 +rounded,44 +counts,34 +toward,34 +nonlegendary,10 +goad,4 +regenerate,9 +eight,21 +splice,29 +beyond,42 +multiple,5 +unpaired,17 +companion,10 +totals,5 +affected,3 +summoning,2 +sickness,4 +else,8 +repeats,2 +whichever,5 +surge,14 +teammate,11 +feather,8 +available,2 +remaining,2 +take,12 +increased,3 +true,8 +fewest,5 +dilemma,6 +sprout,2 +harvest,2 +divide,39 +blockers,23 +nonattacking,3 +drafting,2 +booster,16 +pack,14 +round,6 +packs,2 +passed,2 +detain,8 +infect,20 +pick,1 +drafted,15 +hour,12 +looks,6 +separates,6 +face-down,17 +spend,24 +exploits,10 +nonred,4 +face-up,9 +poisoned,4 +choosing,3 +part,3 +must,28 +greatest,29 +surveil,16 +cumulative,7 +petrification,1 +attaches,1 +reduce,15 +nothing,2 +brick,10 +mire,5 +nongreen,8 +includes,6 +include,1 +activation,10 +prevents,1 +investigate,16 +commander,6 +source's,10 +fateseal,2 +mode,10 +libraries,20 +plainswalk,7 +populate,4 +incarnation,2 +nine,3 +mark,8 +represent,9 +double-faced,10 +count,5 +lowest,6 +unattached,19 +rampage,7 +contains,8 +couldn't,11 +cleanup,14 +active,5 +maximum,30 +size,33 +playing,20 +ante,15 +ownership,4 +she,1 +unity,2 +plot,2 +changeling,3 +riot,2 +sacrificing,15 +reduced,19 +stays,15 +need,4 +gone,4 +adventure,4 +evenly,2 +armor,12 +resolving,5 +haunting,10 +haunts,10 +note,10 +transformed,1 +ability's,5 +produce,22 +escaped,2 +everything,2 +untaps,18 +hit,2 +created,11 +mountainwalk,11 +artifact's,20 +bounty,5 +fate,6 +enchantment's,5 +haven't,4 +added,1 +following,1 +continues,1 +cube,2 +infection,4 +skulk,2 +petal,2 +nonwhite,10 +slivercycling,1 +vanishing,1 +ignore,4 +which,8 +annihilator,2 +chose,2 +plague,4 +distribute,5 +polyp,3 +offering,4 +difference,9 +between,8 +mutated,5 +prowess,2 +amassed,1 +destroys,1 +awaken,1 +loss,12 +works,5 +simultaneously,3 +instants,3 +entering,7 +trigger,9 +ice,13 +transform,2 +strife,3 +flips,6 +undying,4 +dying,2 +rust,3 +cycling,5 +gold,5 +crews,3 +smaller,1 +produces,12 +experience,2 +matter,2 +how,7 +including,9 +neither,1 +nor,1 +blood,8 +keeps,1 +supertypes,1 +did,5 +cry,6 +afflict,1 +filibuster,3 +bid,15 +start,6 +bidding,7 +high,12 +stands,3 +bidder,3 +above,4 +unearth,2 +fortified,1 +investigates,1 +searching,1 +hides,1 +item,1 +items,2 +directly,2 +bands,20 +eon,2 +yet,1 +previously,1 +healing,6 +pin,4 +assemble,1 +assembles,1 +nonsnow,5 +psychosis,2 +mulligan,1 +taking,2 +mulligans,2 +transforms,1 +hatchling,3 +guesses,2 +whether,4 +guessed,3 +wrong,2 +vitality,2 +him,4 +phylactery,2 +triple,1 +wears,5 +off,5 +embalmed,1 +cascade,2 +growth,6 +foreshadow,2 +divinity,17 +cycled,4 +recently,1 +having,5 +legend,2 +rule,2 +apply,3 +tide,12 +sleep,3 +denial,2 +duplication,2 +delay,6 +original,1 +crew,2 +prowl,10 +devoid,1 +training,1 +bushido,2 +stops,1 +started,2 +antes,1 +sleight,3 +carrion,2 +heads,3 +devoured,4 +fifteen,2 +shell,3 +instance,3 +wish,4 +bolster,11 +phasing,4 +corpse,3 +searched,10 +velocity,4 +spliced,1 +doom,6 +begins,2 +survive,2 +muster,2 +drawn,11 +separately,3 +manifests,1 +dethrone,1 +death,6 +ki,12 +prey,2 +poisonous,2 +kinds,3 +elixir,3 +stop,1 +flipping,1 +characteristics,1 +improvise,1 +ended,1 +unattach,4 +replicate,9 +affect,2 +evolves,1 +bribery,2 +her,1 +mine,3 +make,3 +illegal,1 +study,2 +page,7 +strength,2 +numbers,2 +he's,1 +owned,2 +minimum,2 +lethal,2 +marked,2 +soulshift,2 +crystal,2 +voting,3 +choices,2 +outlast,2 +winch,2 +despair,2 +drawing,1 +contain,1 +pressure,4 +team's,2 +unaffected,1 +knowledge,4 +luck,4 +banded,3 +currency,2 +pass,1 +differently,1 +normally,1 +trap,2 +just,2 +adapts,2 +exchanged,1 +omen,3 +became,1 +aim,5 +originally,4 +printed,4 +expansion,4 +ninety-nine,1 +delve,1 +reorder,1 +soulbond,1 +suspend,2 +tie,1 +broken,1 +surveilled,1 +credit,3 +declaring,1 +whom,1 +likewise,1 +assigned,1 +empty,1 +wild,2 +free,2 +theft,2 +began,2 +tower,2 +pupa,3 +use,4 +right,5 +label,1 +coins,5 +money,2 +voter,1 +ore,3 +manifestation,1 +see,4 +decisions,2 +awakening,2 +area,2 +devour,2 +task,3 +arrow,2 +beneath,1 +melee,2 +planar,1 +hourglass,3 +blaze,2 +commanders,4 +partner,4 +ripple,1 +shield,2 +exalted,4 +retains,2 +decide,1 +decides,1 +stakes,1 +net,3 +scavenge,2 +phased-out,1 +enchanting,1 +fading,1 +swap,1 +gem,2 +passes,1 +vortex,3 +totem,1 +taxes,2 +egg,4 +absorb,1 +magnet,5 +they've,1 +twelfth,1 +far,1 +reselect,1 +legal,1 +slumber,3 +eternalize,2 +embalm,2 +scream,6 +exploited,2 +convoked,1 +championed,1 +resolve,1 +thirteen,1 +frenzy,1 +modular,1 +drafts,1 +guess,1 +correctly,1 +bloodthirst,1 +rules,1 +kicks,1 +quill,2 +manifested,1 +glyph,3 +unopened,1 +looked,1 +seventh,1 +teammates,1 +wage,3 +himself,1 +finishes,1 +doing,1 +using,2 +affinity,1 +height,2 +foot,2 +completely,2 +touches,1 +torture,2 +carnage,2 +homage,2 +words,1 +changed,1 +generic,1 +provoke,1 +shred,2 +hadn't,1 +nonblocking,1 +isolation,2 +paralyzation,3 +point,1 +none,1 +subgame,2 +decks,1 +wind,6 +soot,2 +ways,1 +dream,5 +islandcycling,1 +finish,1 +voted,1 diff --git a/mtgkeywords.csv b/mtgkeywords.csv new file mode 100644 index 0000000..d3dbc10 --- /dev/null +++ b/mtgkeywords.csv @@ -0,0 +1,211 @@ +keyword,frequency +Enchant,875 +Flying,1565 +Adapt,12 +Horsemanship,26 +Landwalk,114 +Swampwalk,39 +Kicker,132 +Enrage,16 +Domain,27 +Cycling,199 +Bloodthirst,14 +Trample,403 +Flash,227 +Prowess,39 +Revolt,16 +First strike,211 +Fight,62 +Multikicker,9 +Awaken,13 +Hexproof,51 +Heroic,41 +Islandwalk,27 +Scry,166 +Exalted,29 +Menace,77 +Cohort,9 +Mountainwalk,17 +Flashback,84 +Haste,285 +Reach,128 +Bestow,29 +Renown,18 +Forestwalk,24 +Cascade,8 +Equip,232 +Devoid,98 +Protection,165 +Amass,22 +Vigilance,215 +Addendum,9 +Morbid,17 +Cumulative upkeep,79 +Threshold,81 +Indestructible,51 +Graft,13 +Assist,16 +Manifest,15 +Defender,220 +Rebound,20 +Madness,30 +Infect,41 +Evoke,13 +Escape,22 +Overload,14 +Clash,25 +Double strike,41 +Channel,10 +Bushido,34 +Modular,12 +Sunburst,14 +Mill,231 +Partner,26 +Reinforce,2 +Will of the council,9 +Flanking,27 +Chroma,9 +Ripple,5 +Ninjutsu,6 +Undying,13 +Surveil,17 +Suspend,45 +Exert,22 +Conspire,9 +Landcycling,11 +Basic landcycling,4 +Typecycling,13 +Tribute,11 +Landfall,73 +Megamorph,25 +Vanishing,13 +Shroud,32 +Retrace,10 +Dash,17 +Dethrone,7 +Lifelink,119 +Ascend,23 +Affinity,18 +Metalcraft,27 +Unleash,13 +Convoke,45 +Entwine,24 +Ingest,9 +Deathtouch,107 +Hidden agenda,15 +Shadow,34 +Monstrosity,23 +Transmute,13 +Mentor,13 +Delve,23 +Delirium,37 +Mutate,30 +Spell mastery,15 +Fear,32 +Kinship,12 +Melee,6 +Grandeur,5 +Support,11 +Adamant,17 +Evolve,13 +Radiance,8 +Echo,44 +Morph,126 +Level Up,18 +Fading,16 +Proliferate,26 +Explore,13 +Changeling,31 +Split second,10 +Persist,19 +Afterlife,10 +Intimidate,17 +Spectacle,10 +Scavenge,11 +Bolster,19 +Meld,3 +Amplify,9 +Buyback,39 +Epic,5 +Improvise,13 +Riot,11 +Soulshift,26 +Living weapon,8 +Battalion,12 +Cipher,11 +Legendary landwalk,2 +Raid,29 +Unearth,17 +Miracle,7 +Phasing,12 +Swampcycling,1 +Constellation,25 +Goad,5 +Splice,29 +Crew,29 +Rampage,12 +Soulbond,17 +Companion,10 +Champion,11 +Surge,11 +Fabricate,14 +Bloodrush,12 +Council's dilemma,6 +Banding,23 +Detain,11 +Outlast,8 +Annihilator,8 +Afflict,9 +Fateful hour,6 +Exploit,11 +Extort,8 +Forestcycling,2 +Dredge,11 +Ferocious,19 +Inspired,19 +Forecast,8 +Devour,10 +Converge,11 +Rally,14 +Strive,17 +Investigate,23 +Hellbent,15 +Populate,6 +Storm,14 +Fateseal,1 +Imprint,19 +Escalate,8 +Recover,7 +Wither,24 +Eternalize,9 +Wizardcycling,1 +Hideaway,3 +Emerge,10 +Formidable,12 +Totem armor,11 +Haunt,10 +Transform,4 +Hexproof from,2 +Skulk,8 +Undergrowth,12 +Desertwalk,1 +Slivercycling,1 +Battle Cry,6 +Fortify,1 +Provoke,8 +Transfigure,1 +Assemble,1 +Embalm,13 +Plainswalk,4 +Jump-start,10 +Islandcycling,2 +Prowl,7 +Lieutenant,1 +Mountaincycling,1 +Replicate,6 +Nonbasic landwalk,1 +Parley,4 +Sweep,4 +Aura Swap,1 +Gravestorm,1 +Plainscycling,2