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 | RSS feed

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.

Source Distribution

akrikola-0.1.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

akrikola-0.1-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page