Created
July 6, 2017 11:43
-
-
Save timokoola/3f4bd3140a0497f28496f041d3ce5168 to your computer and use it in GitHub Desktop.
Function to check if a word is an adjective in its baseform in Finnish using libvoikko
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
| from libvoikko import Voikko | |
| v = Voikko("fi") | |
| def adjective(w): | |
| analyzed = v.analyze(w) | |
| for item in analyzed: | |
| if "CLASS" in item and "laatusana" in item["CLASS"] and "SIJAMUOTO" in item and item[ | |
| "SIJAMUOTO"] == "nimento" and w == item["BASEFORM"]: | |
| return True | |
| return False |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example of Voikko output