Hasami
Hasami is a tool to perform sentence segmentation on japanese text.
- In addition to simply splitting on sentence-ending markers like
!?。it will treat runs of sentence-ending characters as a single sentence ending. - It will not split enclosed sentences, i.e. those in quotes or parentheses.
- It can be configured with custom sentence-ending markers and enclosures in case the defaults don't cover your needs.
- You can define exceptions for when not to split sentences.
Installation
pip install hasami
Usage
A simple command line interface is provided to use the functionality
without having to write your own script. Input is read from stdin or from a file.
$ echo "これが最初の文。これは二番目の文。これが最後の文。" | tee input.txt | hasami
これが最初の文。
これは二番目の文。
これが最後の文。
$ hasami input.txt
これが最初の文。
これは二番目の文。
これが最後の文。
To use in your code:
import hasami
hasami.segment_sentences('これが最初の文。これは二番目の文。これが最後の文。')
# => ['これが最初の文。', 'これは二番目の文。', 'これが最後の文。']
More complex examples will follow soon, please refer to the test cases in the meantime.
License
Licensed under the BSD-3-Clause License
Metadata
Release files for hasami 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hasami-0.0.1.tar.gz | 4.3 kB | Without provenance | Details for hasami-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hasami-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for hasami-0.0.1-py3-none-any.whl |
Total release size: 10.6 kB
Release files / hasami-0.0.1.tar.gz
| Download URL | hasami-0.0.1.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9aaffc985fd11bd064b68317f915af3bbd2b5ec3847789cb87f4ca7dddf9d3b
|
|
BLAKE2b-256 checksum How to use checksums |
33ec5ceadc89f041e1b7bb9a2268413b5b1b9ecf513361cb7028bc4fbb0525d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.9
|
Release files / hasami-0.0.1-py3-none-any.whl
| Download URL | hasami-0.0.1-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd5a2d89b7fe00565b036875619eca719972b8f188a6b5b888cad6d324de8ce2
|
|
BLAKE2b-256 checksum How to use checksums |
b7fae19012d6a2584de17ef74b00cc49295d76dc104152118a7bc244ee18f2c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.9
|
Security for hasami 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.