Created
August 24, 2017 19:31
-
-
Save timokoola/4ac17efe0edf0f77aaecdfaf5bcd0097 to your computer and use it in GitHub Desktop.
End syllables of Finnish language verbs in base form (using Kotus sanalist)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import xmltodict | |
| from libvoikko import Voikko | |
| f = open("kotus-sanalista_v1.xml") | |
| text = f.read() | |
| f.close() | |
| kotus = xmltodict.parse(text) | |
| verbs = [x["s"] for x in kotus["kotus-sanalista"]["st"] if "t" in x and "tn" in x["t"] and int(x["t"]["tn"]) >= 52 and int(x["t"]["tn"]) <99 ] | |
| v = Voikko("fi") | |
| ", ".join(sorted(list(set([v.hyphenate(x).split("-")[-1] for x in verbs])))) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output of this is:
'a, da, dä, haa, jaa, jää, kaa, kää, la, laa, lä, lää, löä, mää, na, naa, nee, nä, paa, ra, raa, rä, saa, sää, ta, taa, tä, tää, vaa, vää, ä'