Skip to main content

A light-weight NLP library for Finnish language

Project description

Akrikola

An early version of a light-weight NLP library for Finnish language.

Use case

In Finnish language the rules for selecting noun cases "in", "from" and "into" for municipality names are complicated. Even Finns have problem selecting the correct case when using a less common municipality name. In Finland there are over 300 municipalities. This library provides correct case endings.

Use case explained in Finnish / Käyttötarkoitus suomeksi

Suomalaisten kuntien, kaupunkien ja muiden asutusten nimiä taivutetaan siten kuin paikkakunnalla on totuttu taivuttamaan. Tämä kirjasto taivuttaa suomalaisten kuntien nimet sisä- ja ulkopaikallissijoissa sekä partitiivissa ja genetiivissä. Lisäksi kirjastolla voi tunnistaa kuntien nimiä kaikissa mainituissa taivutusmuodoissa.

Using Akrikola

To conjugate municipalities just import Municipality class and create an instance with the name of the municipality.

from akrikola import Municipality

town = Municipality("Ylivieska")
print(town.departure)
print(town.destination)
print(town.at)

Will produce:

Ylivieska
Ylivieskaan
Ylivieskassa

Also nominative, partitive and genetive forms can be produced:

city = Municipality("Kauniainen")
print(city.name)
print(city.partitive)
print(city.genetive)
print(city.in_swedish)

Will produce:

Kauniainen
Kauniaista
Kauniaisten
Grankulla

Note that the class will throw KeyError at instance creation if the word is not a name of a municipality.

To check if a word is a municipality name in any the six recognized noun cases (plus in swedish):

from akrikola import Municipality

Municipality.exists("Hattula")
# return True
Municipality.exists("Hattula")
# return False

Author

This project is licensed under the terms of the GNU Lesser General Public License v3.0 (GNU LGPLv3). See LICENSE.txt for more information.

Project details


Release history Release notifications

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for akrikola, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size akrikola-0.1-py3-none-any.whl (4.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size akrikola-0.1.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page