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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ltscore-1.0.0.tar.gz.
File metadata
- Download URL: ltscore-1.0.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e51d592805752a68b40a8db039ae60d957696c0ca87c2a14c30c574a372ee2b
|
|
| MD5 |
4a43dffa9e2aadb1e63b98f67120f55c
|
|
| BLAKE2b-256 |
a03af5767d9bfa91a162dd1438126fbdc1effb64cc5a11eea3d624211a21e02a
|
Provenance
The following attestation bundles were made for ltscore-1.0.0.tar.gz:
Publisher:
publish.yml on Cymru-Breizh/LTScore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ltscore-1.0.0.tar.gz -
Subject digest:
1e51d592805752a68b40a8db039ae60d957696c0ca87c2a14c30c574a372ee2b - Sigstore transparency entry: 1411018299
- Sigstore integration time:
-
Permalink:
Cymru-Breizh/LTScore@1f947aab40d13c35e8ade79160e112fff7c84136 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Cymru-Breizh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1f947aab40d13c35e8ade79160e112fff7c84136 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ltscore-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ltscore-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fdf5e366a81329a7de8e55d33a303d3f6a251b3784f74d267288cdc6412eeac
|
|
| MD5 |
3397831969f607cfca1da74ebffee332
|
|
| BLAKE2b-256 |
71166d38106e0eb3d510b0bfb6231b4943aab8fa9bda525c9c5cc40bfb6def17
|
Provenance
The following attestation bundles were made for ltscore-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on Cymru-Breizh/LTScore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ltscore-1.0.0-py3-none-any.whl -
Subject digest:
8fdf5e366a81329a7de8e55d33a303d3f6a251b3784f74d267288cdc6412eeac - Sigstore transparency entry: 1411018402
- Sigstore integration time:
-
Permalink:
Cymru-Breizh/LTScore@1f947aab40d13c35e8ade79160e112fff7c84136 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Cymru-Breizh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1f947aab40d13c35e8ade79160e112fff7c84136 -
Trigger Event:
push
-
Statement type: