Matching texts across languages.
Project description
String Pod
Matching texts across languages
- Documentation: https://jyyyeung.github.io/stringpod
- GitHub: https://github.com/jyyyeung/stringpod
- PyPI: https://pypi.org/project/stringpod/
- Free software: MIT
Features
- Normalize text with options
- Check if a text contains a substring
- Parse numbers from text
- Compare pinyin of two texts
Usage
Contains
Check if a text contains a substring, with options.
stringpod contains "Hello, world!" "world"
stringpod contains " Hello, world! " "lo, wor" --options "strip_whitespace,ignore_case"
stringpod contains "歌曲(純音樂)" "(纯音乐)" --options "ignore_chinese_variant"
Normalize
Normalize text to a standard form.
stringpod normalize "Hello, World!!!"
stringpod normalize " Hello, World!!!" --options "all"
stringpod normalize "歌曲(純音樂)" --options "ignore_chinese_variant"
Normalizer Options
strip_whitespace: Strip whitespace (leading and trailing) from the text (default:False)remove_whitespace: Remove whitespace (all whitespace characters) from the text (default:False)strip_whitespacewill not be needed ifremove_whitespaceisTrue
ignore_chinese_variant: Ignore Chinese variant (default:False)ignore_case: Ignore case (default:False)- English will be converted to lowercase
- Chinese will be converted to simplified Chinese
nfkc: Normalize to NFKC (default:True)
Number Parser
Parse numbers from text.
stringpod number "One hundred and twenty-three"
stringpod number "One hundred and twenty-three" --language "en"
Number Parser Options
language: Language of the number (default:en)
Compare Pinyin
Compare pinyin of two texts.
stringpod cmp-pinyin "你好" "你号"
stringpod cmp-pinyin "你好" "你号" --options "with_tone"
stringpod cmp-pinyin "你好" "你号" --options "spoken_tone"
Pinyin Options
with_tone: Whether to include the tone (default:False)spoken_tone: Whether to use the spoken tone (default:False)
Development
poetry install -E dev -E docs -E test
poetry run pre-commit install
CLI Application
poetry run python -m stringpod.cli --help
Python API
poetry run python -m stringpod.stringpod --help
Testing
poetry run pytest # Run Pytest
poetry run python -m stringpod.stringpod -v # Run Doctests
Credits
Core packages:
This package was created with Cookiecutter and the waynerv/cookiecutter-pypackage project template.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
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 stringpod-0.2.2.tar.gz.
File metadata
- Download URL: stringpod-0.2.2.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32e8068bbc2eeb3d78fc23eca38606067af3617d3ebcae209215518591213f7f
|
|
| MD5 |
757a5488457dc3f935c7ce1baefb3eff
|
|
| BLAKE2b-256 |
a65e096ed38d7a79e470af4e713dc98897d9f433d8433bed2fde515cb6934b76
|
Provenance
The following attestation bundles were made for stringpod-0.2.2.tar.gz:
Publisher:
release.yml on jyyyeung/stringpod
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stringpod-0.2.2.tar.gz -
Subject digest:
32e8068bbc2eeb3d78fc23eca38606067af3617d3ebcae209215518591213f7f - Sigstore transparency entry: 173666327
- Sigstore integration time:
-
Permalink:
jyyyeung/stringpod@1c443cc845e113ec18866ec5700e73133a2108b8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jyyyeung
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1c443cc845e113ec18866ec5700e73133a2108b8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file stringpod-0.2.2-py3-none-any.whl.
File metadata
- Download URL: stringpod-0.2.2-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afc60de9f9ecfb4997986c0c5f7dcfb9eca07f58bb6e01b467a1dd9b1d91d378
|
|
| MD5 |
8cd428a71ddcf4746202dd1a07f309a3
|
|
| BLAKE2b-256 |
2248aefed8a00bb89fc751d597f0b1e7ec27e591c0a476853bd0ef1ed5467837
|
Provenance
The following attestation bundles were made for stringpod-0.2.2-py3-none-any.whl:
Publisher:
release.yml on jyyyeung/stringpod
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stringpod-0.2.2-py3-none-any.whl -
Subject digest:
afc60de9f9ecfb4997986c0c5f7dcfb9eca07f58bb6e01b467a1dd9b1d91d378 - Sigstore transparency entry: 173666329
- Sigstore integration time:
-
Permalink:
jyyyeung/stringpod@1c443cc845e113ec18866ec5700e73133a2108b8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jyyyeung
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1c443cc845e113ec18866ec5700e73133a2108b8 -
Trigger Event:
workflow_dispatch
-
Statement type: