Parallel corpus as a graph.
Project description
parallel-corpus
Parallel corpus as a graph.
Ported from Graph in spraakbanken/swell-editor.
Install
To install parallel-corpus
in the current environment:
pip install parallel-corpus
To add parallel-corpus
to a PDM project:
pdm add parallel-corpus
To add parallel-corpus
manually to pyproject.toml
:
[project]
dependencies = ["parallel-corpus>=0.1.0"]
Usage
first = "Jonathan saknades ."
# Initialize graph with source and target equal.
g = graph.init(first)
second = "Jonat han saknades ."
# Update target with new text.
gm = graph.set_target(g, second)
# The graph will now contain a edge from 'Jonathan' and both 'Jonat' and 'han'.
print(f"{gm.edges=}")
Changelog
This project keeps a changelog.
Development
This project uses conventional commits.
Tools used:
- pdm for project management.
- pre-commit for pre-commit checking
- runs ruff linter
- runs ruff formatter
- checks that commit message is according conventional commits.
- install hooks with
pre-commit install
.
- git-cliff for changelog updates.
- bump-my-version for version bumping.
- syrupy for snapshot testing.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
parallel_corpus-0.1.0.tar.gz
(22.3 kB
view hashes)
Built Distribution
Close
Hashes for parallel_corpus-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b8d83dd121822c1348695abd596022d337103fba30f085b54af2a35d84dcba1 |
|
MD5 | fe76401d4055386e46c80545a01bb185 |
|
BLAKE2b-256 | 199971f66c513629d0528d39aedeeacbf04a6973f26e6022f751aecc41dbdae7 |