-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bugs in for translation & added unique forms check #551
Changes from 6 commits
0fe6864
15735d3
c1bec87
78b82c0
192b09c
cfc2777
e302a9b
69c961a
0457372
6a6f545
2479fe2
386d6a0
a532890
8c10962
789b178
06d77b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,8 +166,9 @@ def main() -> None: | |
get_parser.add_argument( | ||
"-wdp", | ||
"--wikidata-dump-path", | ||
type=str, | ||
help="Path to a local Wikidata lexemes dump for running with '--all'.", | ||
nargs="?", | ||
const="", | ||
help="Path to a local Wikidata lexemes dump. Uses default directory if no path provided.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This here made me wonder.. |
||
) | ||
get_parser.add_argument( | ||
"-t", "--translation", type=str, help="parse a single word using MediaWiki API" | ||
|
@@ -364,8 +365,11 @@ def main() -> None: | |
if args.interactive: | ||
start_interactive_mode(operation="get") | ||
if args.translation: | ||
parse_wiktionary_translations(args.translation) | ||
parse_wiktionary_translations(args.translation, args.output_dir) | ||
else: | ||
print( | ||
f"Parsing Wikidata lexeme dump for {args.language} and {args.data_type}" | ||
) | ||
get_data( | ||
language=args.language.lower() | ||
if args.language is not None | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -367,11 +367,15 @@ def total_wrapper( | |
""" | ||
# Handle --all flag | ||
if all_bool and wikidata_dump: | ||
language = "all" | ||
if data_type is None: | ||
data_type = "all" | ||
if language is None: | ||
language = "all" | ||
Comment on lines
351
to
+355
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit - a quick suggestion: The in-source docs here and elsewhere in the repo mention the following:
This seems a tad misleading since setting a specific
|
||
|
||
if wikidata_dump is True: # flag without a wikidata lexeme dump path | ||
parse_wd_lexeme_dump( | ||
language=language, | ||
data_types=[data_type], | ||
wikidata_dump_type=["total"], | ||
wikidata_dump_path=None, | ||
) | ||
|
@@ -380,6 +384,7 @@ def total_wrapper( | |
if isinstance(wikidata_dump, str): # if user provided a wikidata lexeme dump path | ||
parse_wd_lexeme_dump( | ||
language=language, | ||
data_types=[data_type], | ||
wikidata_dump_type=["total"], | ||
wikidata_dump_path=wikidata_dump, | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering for myself -
but this is simply just a check for if
wikidata_dump
is an empty string""
? Did I get that right?