Skip to main content

A multilingual grammaticality util based on LanguageTool

Project description

LTScore

Cysill wrapper to score Welsh texts' grammaticality. As it connects to the Cysill API, ensure to have a working internet connexion before using it.

Installation:

pip install ltscore

Run the Docker image locally

You can download the LanguageTool image from Docker Hub, then using the port 8010 as indicated below.

docker pull erikvl87/languagetool
docker run --rm -p 8010:8010 erikvl87/languagetool

For more details about the Docker container's configuration, see this link.

LTScore as a CLI

There are two ways to use the CLI, either by entering a text file's path, or directly a text. The CLI returns a string of numbers representing the grammaticality score of the text.

# With a text as a positional character
ltscore -l br "Kalz a tud a zo amañ!"
# With a -p or --path flag
ltscore -l br -p ./src/ltscore/assets/text-sample-br.txt 

or alternatively with the pipe operator:

cat src/ltscore/assets/text-sample-br.txt | ltscore -l br

LTScore as a library

One can also use this package as a python library:

from ltscore import get_score, get_mistakes

# get the scores
df["scores"] = df.apply(lambda row: get_score(row["text"], language=row["language"]), axis=1)
# returns a list of mistakes for each text
df["mistakes"] = df.apply(lambda row: get_mistakes(row["text"], language=row["language"]), axis=1)

Project details


Download files

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

Source Distribution

ltscore-0.2.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

ltscore-0.2.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file ltscore-0.2.0.tar.gz.

File metadata

  • Download URL: ltscore-0.2.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ltscore-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a37c5aadd4a6962a2dc6da09f50a612695e9b520cab9a271caa6f2c391a4dbc8
MD5 5f27664f7cc6e156f5b2b3a98551ebaf
BLAKE2b-256 dd8649f4f9fa9f5870c89b50611fe95ef7bfdbe04d42f01798c438c7303cfea4

See more details on using hashes here.

Provenance

The following attestation bundles were made for ltscore-0.2.0.tar.gz:

Publisher: publish.yml on Cymru-Breizh/LTScore

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ltscore-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ltscore-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ltscore-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2022b35644099d68dfc54ee38e0744c2105c5ed2046d84795cd3d9dab06087f4
MD5 a944efbf97dc1fac2c01ba4bc5b62fcd
BLAKE2b-256 7ea34b662938e6e0a36657f72105cac2415b61c0fa0e015a8914fb7f8e2b7c0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ltscore-0.2.0-py3-none-any.whl:

Publisher: publish.yml on Cymru-Breizh/LTScore

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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