Skip to main content

Pure Python, no dependencies, simple word accent setter, based on ngram model.

Project description

Simple word accent setter.

Pure Python, no dependencies. Based on ngram model.

Trained for the Russian language, on a corpus of ~1000000 word forms, taking into account their frequency in real texts. Accuracy ~97-98%. Speed ~10000 words per second.

from ruccent import Accent

accenter = Accent()
accenter.predict('пробойник')  # -> 4

You can train the model yourself for your language or corpus.

from ruccent import Accent, AccentTrain

# iterable of tuple (accent position, weight/frequency, word)
dataset = [(3, 10, 'begin'), (1, 1, 'happy')]
train = AccentTrain()
train.fit(dataset, ngram=(3,7))
train.save('path/yourself.model')

accenter = Accent('path/yourself.model')
accenter.predict('begin')

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

ruccent-1.0.2-py3-none-any.whl (3.3 MB view details)

Uploaded Python 3

File details

Details for the file ruccent-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: ruccent-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0b4

File hashes

Hashes for ruccent-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2683c76754fc24e21ee667e86ef967dffc604f3abbcf0d2b1367dc5072dba3a9
MD5 7df8a89966c45140b624730286f90984
BLAKE2b-256 ae71066a1ae6c98bc02bfcbec33e276c0b034be484fa35c4979174b7e2c4d8e4

See more details on using hashes here.

Supported by

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