# HG changeset patch # User Oleksandr Gavenko # Date 1478945524 -7200 # Node ID ca1d4a6e201b1a159ac56842c9a2f29594d5fee6 # Parent dc5379ac792d8f16eb34a5009b66a8f1d3f64ad4 Option to include Irregular verb and plural form. diff -r dc5379ac792d -r ca1d4a6e201b Makefile --- a/Makefile Sat Nov 12 00:48:32 2016 +0200 +++ b/Makefile Sat Nov 12 12:12:04 2016 +0200 @@ -529,13 +529,13 @@ anki: $(SRS_ANKI_FILES) dist/anki/%.apkg: %.gadict %.del py/gadict.py py/gadict_srs_anki.py $(FREQLIST_DEP) $(MAKEFILE_LIST) | dist/anki/ - PYTHONPATH=/usr/share/anki: python -B py/gadict_srs_anki.py $(FREQLIST_OPT) $< $@ + PYTHONPATH=/usr/share/anki: python -B py/gadict_srs_anki.py -rich $(FREQLIST_OPT) $< $@ dist/anki/gadict_voa.apkg: gadict_voa.gadict py/gadict.py py/gadict_srs_anki.py $(VOA_FREQLIST_DEP) $(MAKEFILE_LIST) | dist/anki/ PYTHONPATH=/usr/share/anki: python -B py/gadict_srs_anki.py $(VOA_FREQLIST_OPT) $< $@ dist/anki/%.apkg: %.gadict py/gadict.py py/gadict_srs_anki.py $(FREQLIST_DEP) $(MAKEFILE_LIST) | dist/anki/ - PYTHONPATH=/usr/share/anki: python -B py/gadict_srs_anki.py $(FREQLIST_OPT) $< $@ + PYTHONPATH=/usr/share/anki: python -B py/gadict_srs_anki.py -rich $(FREQLIST_OPT) $< $@ dist/srs/gadict_en-ru+uk.tab.txt: gadict_en-ru+uk.gadict py/gadict.py py/gadict_srs_tab.py $(MAKEFILE_LIST) | dist/srs/ python3 -B py/gadict_srs_tab.py $< $@ -lang:ru,uk diff -r dc5379ac792d -r ca1d4a6e201b py/gadict_srs_anki.py --- a/py/gadict_srs_anki.py Sat Nov 12 00:48:32 2016 +0200 +++ b/py/gadict_srs_anki.py Sat Nov 12 12:12:04 2016 +0200 @@ -18,6 +18,7 @@ FONAME = None LANGS = None FREQ_SOURCES = [] +RICH_MODE = False # -lang:ru,uk ARG_LANG_RE = regex.compile("-lang:(.+)") @@ -53,6 +54,9 @@ wlist = parser.parse() FREQ_SOURCES.append((tag, set(wlist))) continue + if arg == "-rich": + RICH_MODE = True + continue if arg.startswith("-"): raise Exception("Unsupported option format: '{:s}'".format(arg)) if not FINAME: @@ -360,7 +364,7 @@ reverse_from = "".join(buf) # without examples!! builder.add_note("en->tr", identity, direct_from + freqmsg, direct_to) builder.add_note("tr->en", identity, reverse_from, direct_from + freqmsg) - if v1 and v2 and v3: + if v1 and v2 and v3 and RICH_MODE: question = u"
Find irregular verb:
" riddle1 = u"{} [{}] v1".format(v1[0], v1[1]) riddle2 = u"{} [{}] v2".format(v2[0], v2[1]) @@ -369,7 +373,7 @@ builder.add_note("irregular1", identity, question + riddle1 + freqmsg, answer) builder.add_note("irregular2", identity, question + riddle2 + freqmsg, answer) builder.add_note("irregular3", identity, question + riddle3 + freqmsg, answer) - if singular and plural: + if singular and plural and RICH_MODE: question = u"
Find plural:
" riddle_s = u"{} [{}] s".format(singular[0], singular[1]) riddle_pl = u"{} [{}] pl".format(plural[0], plural[1])