-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9aecb1d
commit fa5b6a6
Showing
6 changed files
with
474 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[tool.bumpversion] | ||
current_version = "0.0.1" | ||
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)" | ||
serialize = ["{major}.{minor}.{patch}"] | ||
tag = true | ||
sign_tags = true | ||
tag_name = "v{new_version}" | ||
tag_message = "bump version: {current_version} → {new_version}" | ||
allow_dirty = false | ||
commit = true | ||
message = "chore(release): Bump version: {current_version} → {new_version}" | ||
commit_args = "--no-verify" | ||
|
||
[[tool.bumpversion.files]] | ||
filename = "pyproject.toml" | ||
search = 'version = "{current_version}"' | ||
replace = 'version = "{new_version}"' | ||
|
||
[[tool.bumpversion.files]] | ||
filename = "CHANGELOG.md" | ||
search = '## [unreleased]' | ||
replace = '## [{new_version}] - {now:%Y-%m-%d}' | ||
|
||
[[tool.bumpversion.files]] | ||
filename = "README.md" | ||
search = '"parallel-corpus>={current_version}"' | ||
replace = '"parallel-corpus>={new_version}"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [unreleased] | ||
|
||
### Added | ||
|
||
- Import code from [Graph from spraakbanken/swell-editor](https://github.com/spraakbanken/swell-editor) | ||
- Port Graph::init | ||
- Port lists.rearrange | ||
|
||
<!-- generated by git-cliff --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,77 @@ | ||
# graph-py | ||
# parallel-corpus | ||
|
||
[![PyPI version](https://badge.fury.io/py/parallel-corpus.svg)](https://pypi.org/project/parallel-corpus) | ||
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/parallel-corpus) | ||
[![PyPI - Downloads](https://img.shields.io/pypi/dm/parallel-corpus)](https://pypi.org/project/parallel-corpus/) | ||
|
||
[![Maturity badge - level 2](https://img.shields.io/badge/Maturity-Level%202%20--%20First%20Release-yellowgreen.svg)](https://github.com/spraakbanken/getting-started/blob/main/scorecard.md) | ||
[![Stage](https://img.shields.io/pypi/status/parallel-corpus)](https://pypi.org/project/parallel-corpus/) | ||
|
||
[![Codecov](https://codecov.io/gh/spraakbanken/parallel-corpus-py/coverage.svg)](https://codecov.io/gh/spraakbanken/parallel-corpus-py) | ||
[![CI(release)](https://github.com/spraakbanken/parallel-corpus-py/actions/workflows/release-kb-bert.yml/badge.svg)](https://github.com/spraakbanken/parallel-corpus-py/actions/workflows/release-kb-bert.yml) | ||
[![CI(check)](https://github.com/spraakbanken/parallel-corpus-py/actions/workflows/check.yml/badge.svg)](https://github.com/spraakbanken/parallel-corpus-py/actions/workflows/check.yml) | ||
[![CI(test)](https://github.com/spraakbanken/parallel-corpus-py/actions/workflows/test.yml/badge.svg)](https://github.com/spraakbanken/parallel-corpus-py/actions/workflows/test.yml) | ||
[![CI(scheduled)](https://github.com/spraakbanken/parallel-corpus-py/actions/workflows/scheduled.yml/badge.svg)](https://github.com/spraakbanken/parallel-corpus-py/actions/workflows/scheduled.yml) | ||
|
||
Parallel corpus as a graph. | ||
|
||
Ported from [Graph in spraakbanken/swell-editor](https://github.com/spraakbanken/swell-editor). | ||
|
||
## Install | ||
|
||
To install `parallel-corpus` in the current environment: | ||
|
||
```shell | ||
pip install parallel-corpus | ||
``` | ||
|
||
To add `parallel-corpus` to a [PDM](https://pdm-project.org) project: | ||
|
||
```shell | ||
pdm add parallel-corpus | ||
``` | ||
|
||
To add `parallel-corpus` manually to `pyproject.toml`: | ||
|
||
```toml | ||
[project] | ||
dependencies = ["parallel-corpus>=0.0.1"] | ||
``` | ||
|
||
## Usage | ||
|
||
```python | ||
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](./CHANGELOG.md). | ||
|
||
## Development | ||
|
||
This project uses [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). | ||
|
||
Tools used: | ||
|
||
- [pdm](https://pdm-project.org) for project management. | ||
- [pre-commit](https://pre-commit.com/) 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](https://github.com/orhun/git-cliff) for changelog updates. | ||
- [bump-my-version](https://github.com/callowayproject/bump-my-version) for version bumping. | ||
- [syrupy](https://github.com/tophat/syrupy) for snapshot testing. |
Oops, something went wrong.