Skip to main content

AklStemmer

A Python library for Aklanon word stemming

About

AklStemmer is a library that finds the root form of Aklanon words. It works on inflected words, even those with mixed Aklanon-English terms or those not found in dictionaries. It removes affixes, reduces repeated syllables, and applies transformation rules to find possible root forms. These are filtered using a list of valid words and conditions. The best root is then chosen based on how much was changed during the process.

Installation

pip install aklstemmer

Usage

AklStemmer acts as a standalone library that can be imported via from aklstemmer import stemmer.

Use get_stem to get the root of a word. This takes a word and returns its stem as a Stem object (basically a string with affixes, reduplication, transformations, etc. as additional attributes).

stem = stemmer.get_stem("nagsueat")
print(stem)
# Output: 'sueat'

Since get_stem returns a Stem object, the properties used in the stemming process can be accessed as attributes.

prefix = stem.pre
print(prefix)
# Output: 'nag'

suffix = stem.suf
print(suffix)
# Output: None

Use get_stems to get the root of each word in a text. This takes a text and returns the stem of each word as a list of Stem objects.

stems = stemmer.get_stems("nagsueat, binasa, ag gision")
print(stems)
# Output: ['sueat', 'basa', 'at', 'gisi']

Use get_stem_candidates to get all the stem candidates of a word. This takes a word and returns the possible stems as a list of Stem objects. This is helpful for loose checking considering candidate selection is not perfect.

candidates = stemmer.get_stem_candidates("bukot")
print(candidates)
# Output: ['bukot', 'buko', 'bukon']

Accuracy

The accuracy hasn't been tested yet.

Development

This project uses uv for dependency management.

Clone the repo and sync dependencies (including dev and test groups):

git clone https://github.com/andrianllmm/tagalog-stemmer.git
cd tagalog-stemmer
uv sync --all-groups

Run the tests:

uv run pytest

Download files

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

Source Distribution

aklstemmer-0.1.0.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aklstemmer-0.1.0-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file aklstemmer-0.1.0.tar.gz.

File metadata

  • Download URL: aklstemmer-0.1.0.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for aklstemmer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3c2be475ac9d3c3821ed01abc4a9df12738d3777994fa5eed367aef798cd0cd1
MD5 235600f47a3a40fcecce54532fc663ae
BLAKE2b-256 2f0180234490057a12f147d8a63cf6cfd6f6ea1332fa5fece0a8947e36685acc

See more details on using hashes here.

File details

Details for the file aklstemmer-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: aklstemmer-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for aklstemmer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c603b43f85661e960339caac6d882bad9c330088367123eb183618cb97dd34a6
MD5 1efcd848a175eff2d8d72b2c256c002a
BLAKE2b-256 272be41c890cc87f213fbddcc556427ee672807b979e0b61e4aa11fb05659f08

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page