Find Best String
Description
Finds the best matching string in a larger string. Returns either the first match or all matches, and their match value.
Installation
pip install find-best-string
or
pipenv install find-best-string
Arguments
- query - String of text to find matches of in corpus.
- corpus - String of text to scan for matches of query.
- step - Step size of first match-value scan through corpus. Can be thought of as a sort of "scan resolution". Should not exceed length of query.
- flex - Max left/right substring position adjustment value. Should not exceed length of query / 2.
- case_sensitive - If false, converts corpus and query to lowercase before fiding matches.
Usage
from find_best_string import find_best_string
corpus = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
query = "Ipsum"
first_match = find_best_string(query, corpus)
Metadata
Release files for find-best-string 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| find_best_string-0.1.0.tar.gz | 13.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| find_best_string-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.8 kB
Release files / find_best_string-0.1.0.tar.gz
| Download URL | find_best_string-0.1.0.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5fe34ee681b42dd12e2de4a3a3b50364eb81adfe24ebf5f913d265fcaba08620
|
|
BLAKE2b-256 checksum How to use checksums |
00df14f325570411b4d26f3267df13ed29c7fa1db9221ac13962c8ea68ffe4f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
|
Release files / find_best_string-0.1.0-py3-none-any.whl
| Download URL | find_best_string-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bfb401c6c959ba1cd42b2e026290650bef38fdf5492a607fe503eb58a3800787
|
|
BLAKE2b-256 checksum How to use checksums |
667bdf5c377b7acdb7720f5072193335ac6570212fcf372e15fc16cde9a7c9fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
|