Skip to content

Commit

Permalink
Merge pull request #963 from xxyzz/doc
Browse files Browse the repository at this point in the history
Add choices to `--edition` command option
  • Loading branch information
xxyzz authored Jan 2, 2025
2 parents b169b2b + 61c348d commit 82a5bb8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ The following command-line options can be used to control its operation:
* --all-languages: extract words for all available languages
* --language-code LANGUAGE_CODE: extracts the given language (this option may be specified multiple times; defaults to dump file language code and `mul`(Translingual))
* --language-name LANGUAGE_NAME: Similar to `--language-code` except this option accepts language name
* --dump-file-language-code LANGUAGE_CODE: specifies the language code for the Wiktionary edition that the dump file is for (defaults to "en"; "zh" is supported and others are being added)
* --edition LANGUAGE_CODE: specifies the language code for the Wiktionary edition that the dump file is for (defaults to "en"; other supported editions are listed in `-h` help descriptions)
* --skip-extraction: Used to create a database file from the dump file without waiting for the extraction process to complete.
* --all: causes all data to be captured for the selected languages
* --translations: causes translations to be captured
Expand Down
7 changes: 7 additions & 0 deletions src/wiktextract/wiktwords.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ def main():
"--edition",
type=str,
default="en",
choices=[
p.stem
for p in (files("wiktextract") / "extractor").iterdir()
if p.is_dir()
and p.stem != "template"
and (p / "models.py").is_file()
],
help="Language code of the dump file.",
)
parser.add_argument(
Expand Down

0 comments on commit 82a5bb8

Please sign in to comment.