Skip to main content

AklStemmer

A Python library for Aklanon word stemming.

PyPI version Downloads License GitHub stars CI pre-commit.ci status

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, and 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.

get_stem

Gets the root of a word. 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

get_stems

Gets the root of each word in a text. 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']

get_stem_candidates

Gets all the stem candidates of a word. 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/aklanon-stemmer.git
cd aklanon-stemmer
uv sync --all-groups

Run the tests:

uv run pytest

Contributing

Contributions are welcome! See CONTRIBUTING.md for more details.

License

Distributed under the MIT License.

Metadata

Release files for aklstemmer 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aklstemmer 0.1.1
File Size Uploaded
aklstemmer-0.1.1.tar.gz 26.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aklstemmer 0.1.1
File Interpreter ABI Platform
aklstemmer-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 52.1 kB

Release files / aklstemmer-0.1.1.tar.gz

Download URL aklstemmer-0.1.1.tar.gz
Size 26.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a09a79a60f491849b725f12f16ec0e261c0777f2f0360538bf76a2edb933a8a4
BLAKE2b-256 checksum
How to use checksums
9b936842a687ef69d29cd4044f7094bc9b8c729dcac77d9cf338e2b33ee3844c
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / aklstemmer-0.1.1-py3-none-any.whl

Download URL aklstemmer-0.1.1-py3-none-any.whl
Size 25.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
529fcde3a54dbdba5f5a5af8f823f88c19ee939a5c563f19185a56f2206ecfa7
BLAKE2b-256 checksum
How to use checksums
7acc3d5d1f544dfa6c9131503ab7797a48e3ab6d4e9ef4189885d7fd0b01c4fe
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release 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