update documentation

This commit is contained in:
Bill Zorn 2015-11-05 21:43:46 -08:00
parent 49071aefa6
commit 829894d1d0

View file

@ -21,7 +21,8 @@ Functionality is provided by two main driver scripts: encode.py and decode.py. L
### encode.py ### encode.py
``` ```
usage: encode.py [-h] [-d N] [-e {std,rmana,rmana_dual,rfields,vec}] [-s] [-v] usage: encode.py [-h] [-e {std,named,noname,rfields,old,norarity,vec,custom}]
[-r] [--nolinetrans] [--nolabel] [-s] [-v]
infile [outfile] infile [outfile]
positional arguments: positional arguments:
@ -30,43 +31,50 @@ positional arguments:
optional arguments: optional arguments:
-h, --help show this help message and exit -h, --help show this help message and exit
-d N, --duplicate N number of times to duplicate each card -e {std,named,noname,rfields,old,norarity,vec,custom}, --encoding {std,named,noname,rfields,old,norarity,vec,custom}
-e {std,rmana,rmana_dual,rfields,vec}, --encoding {std,rmana,rmana_dual,rfields,vec} encoding format to use
-r, --randomize randomize the order of symbols in mana costs
--nolinetrans don't reorder lines of card text
--nolabel don't label fields
-s, --stable don't randomize the order of the cards -s, --stable don't randomize the order of the cards
-v, --verbose verbose output -v, --verbose verbose output
``` ```
The supported encodings are: The supported encodings are:
Argument | Description Argument | Description
-----------|------------ -----------|------------
std | standard format: |name|supertypes|types|loyalty|subtypes|rarity|pt|cost|text| std | Standard format: `|type|supertype|subtype|loyalty|pt|text|cost|rarity|name|`.
rmana | randomized mana: as standard, but symbols in mana costs will be mixed: {^^UUUU} -> {UU^^UU} named | Name first: `|name|type|supertype|subtype|loyalty|pt|text|cost|rarity|`.
rmana_dual | as rmana, but with a second mana cost field after the text field noname | No name field at all: `|type|supertype|subtype|loyalty|pt|text|cost|rarity|`.
rfields | randomize the order of the fields, and use a label to distinguish which field is which rfields | Randomize the order of the fields, using only the label to distinguish which field is which.
vec | produce a content vector for each card; used with [word2vec](https://code.google.com/p/word2vec/) old | Legacy format: `|name|supertype|type|loyalty|subtype|rarity|pt|cost|text|`. No field labels.
norarity | Older legacy format: `|name|supertype|type|loyalty|subtype|rarity|pt|cost|text|`. No field labels.
vec | Produce a content vector for each card; used with [word2vec](https://code.google.com/p/word2vec/).
custom | Blank format slot, inteded to help users add their own formats to the python source.
### decode.py ### decode.py
``` ```
usage: decode.py [-h] [-g] [-f] [-c] [-d] [--norarity] [-v] [-mse] usage: decode.py [-h] [-e {std,named,noname,rfields,old,norarity,vec,custom}]
[-g] [-f] [-c] [-d] [-v] [-mse]
infile [outfile] infile [outfile]
positional arguments: positional arguments:
infile encoded card file or json corpus to encode infile encoded card file or json corpus to encode
outfile output file, defaults to stdout outfile output file, defaults to stdout
optional arguments: optional arguments:
-h, --help show this help message and exit -h, --help show this help message and exit
-g, --gatherer emulate Gatherer visual spoiler -e {std,named,noname,rfields,old,norarity,vec,custom}, --encoding {std,named,noname,rfields,old,norarity,vec,custom}
-f, --forum use pretty mana encoding for mtgsalvation forum encoding format to use
-c, --creativity use CBOW fuzzy matching to check creativity of cards -g, --gatherer emulate Gatherer visual spoiler
-d, --dump dump out lots of information about invalid cards -f, --forum use pretty mana encoding for mtgsalvation forum
--norarity the card format has no rarity field; use for legacy input -c, --creativity use CBOW fuzzy matching to check creativity of cards
-v, --verbose verbose output -d, --dump dump out lots of information about invalid cards
-mse, --mse use Magic Set Editor 2 encoding; will output as .mse-set -v, --verbose verbose output
file -mse, --mse use Magic Set Editor 2 encoding; will output as .mse-
set file
``` ```
The default output is a text spoiler which modifies the output of the neural net as little as possible while making it human readable. Specifying the -g option will produce a prettier, Gatherer-inspired text spoiler with heavier-weight transformations applied to the text, such as capitalization. The -f option encodes mana symbols in the format used by the mtgsalvation forum; this is useful if you want to cut and paste your spoiler into a post to share it. The default output is a text spoiler which modifies the output of the neural net as little as possible while making it human readable. Specifying the -g option will produce a prettier, Gatherer-inspired text spoiler with heavier-weight transformations applied to the text, such as capitalization. The -f option encodes mana symbols in the format used by the mtgsalvation forum; this is useful if you want to cut and paste your spoiler into a post to share it.