55,15 → 55,19 |
ret[2].append({"id": row["id"], "navi": row["navi"].replace("-", ""), "gloss": row["shorthand"].upper()}) |
endfix = True |
if row["navi"] and row["navi"][-1] in ("-", "+"): |
ret[0].append({"id": row["id"], "navi": row["navi"].replace("-", ""), "gloss": row["shorthand"].upper()}) |
ret[0].append({"id": row["id"], "navi": row["navi"].replace("-", "").replace("+", ""), "gloss": row["shorthand"].upper()}) |
endfix = True |
if not endfix: |
if not row["position"] or row["position"] == "NULL": |
# not actually an affix |
continue |
ret[1].append({"id": row["id"], "navi": row["navi"].replace("-", ""), "gloss": row["shorthand"].upper(), "position": int(row["position"])}) |
ret[1].append({"id": row["id"], "navi": row["navi"], "gloss": row["shorthand"].upper(), "position": int(row["position"])}) |
cur.close() |
db.close() |
|
for subret in ret: |
subret.sort(key=lambda x: len(x["navi"]), reverse=True) |
|
return ret |
|
def translate(wid, language): |