py/gadict_srs_anki.py
changeset 559 2b03300f610c
parent 556 78bf1097106a
child 560 dad049a0f585
equal deleted inserted replaced
558:53fd793e345d 559:2b03300f610c
   196                 buf.append("</span>")
   196                 buf.append("</span>")
   197             if sense.syn_list and len(sense.syn_list) > 0:
   197             if sense.syn_list and len(sense.syn_list) > 0:
   198                 buf.append("<span class='syn'>syn: ")
   198                 buf.append("<span class='syn'>syn: ")
   199                 buf.append("; ".join(["{"+s+"}" for s in sense.syn_list]))
   199                 buf.append("; ".join(["{"+s+"}" for s in sense.syn_list]))
   200                 buf.append("</span>")
   200                 buf.append("</span>")
   201             if len(sense.tr_list) > 1:
   201             for (lang, tr) in sense.tr_list:
   202                 for (lang, tr) in sense.tr_list:
   202                 if len(sense.tr_list) > 1:
   203                     buf.append("<div class='sense'>")
   203                     buf.append("<div class='sense'>")
   204                     buf.append(" <span class='lang'>")
   204                 buf.append(" <span class='lang'>")
   205                     buf.append(lang)
   205                 buf.append(lang)
   206                     buf.append("</span>")
   206                 buf.append("</span>")
   207                     buf.append(" <span class='tr'>")
   207                 buf.append(" <span class='tr'>")
   208                     buf.append(tr)
   208                 buf.append(tr)
   209                     buf.append("</span>")
   209                 buf.append("</span>")
       
   210                 if len(sense.tr_list) > 1:
   210                     buf.append("</div>")
   211                     buf.append("</div>")
   211             else:
       
   212                 for (lang, tr) in sense.tr_list:
       
   213                     buf.append(" <span class='lang'>")
       
   214                     buf.append(lang)
       
   215                     buf.append("</span>")
       
   216                     buf.append(" <span class='tr'>")
       
   217                     buf.append(tr)
       
   218                     buf.append("</span>")
       
   219         direct_to = "".join(buf)
   212         direct_to = "".join(buf)
   220         builder.add_note("en->tr", identity, direct_from, direct_to)
   213         builder.add_note("en->tr", identity, direct_from, direct_to)
   221         builder.add_note("tr->en", identity, direct_to, direct_from)
   214         builder.add_note("tr->en", identity, direct_to, direct_from)
   222         if v1 and v2 and v3:
   215         if v1 and v2 and v3:
   223             question = u"<div class='ask'>Find irregular verb:</div>"
   216             question = u"<div class='ask'>Find irregular verb:</div>"