py/gadict_srs_anki.py
changeset 673 ca1d4a6e201b
parent 657 c1d10b3b9ee4
child 674 fe57401d8109
--- 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"<div class='ask'>Find irregular verb:</div>"
             riddle1 = u"<span class='headword'>{}</span> <span class='pron'>[{}]</span> <span class='attrs'>v1</span>".format(v1[0], v1[1])
             riddle2 = u"<span class='headword'>{}</span> <span class='pron'>[{}]</span> <span class='attrs'>v2</span>".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"<div class='ask'>Find plural:</div>"
             riddle_s = u"<span class='headword'>{}</span> <span class='pron'>[{}]</span> <span class='attrs'>s</span>".format(singular[0], singular[1])
             riddle_pl = u"<span class='headword'>{}</span> <span class='pron'>[{}]</span> <span class='attrs'>pl</span>".format(plural[0], plural[1])