Split a string or group a collection of words into a list by matching another list of similar words, to create accurate subtitles from the actual script and inaccurate (generated) subtitles.
Project description
matchingsplit
Split a string or group a collection of words into a list by matching another list of similar words, to create accurate subtitles from the actual script and inaccurate (generated) subtitles.
Example
from matchingsplit import split
>>> split("this must be a good thing", reference=["this", "is", "a", "good", "thing"])
['this', 'must be', 'a', 'good', 'thing']
>>> split("this is a good thing", reference=["this", "must", "be", "a", "good", "thing"])
['this', '', 'is', 'a', 'good', 'thing']
>>> split("a big foo bar", ["a", "big", "ff"])
['a', 'big', 'foo bar']
>>> split("line1.\n\nline2.\nline3.", reference=["1", "2", "3"], preserve_newlines=True)
['line1.\n\n', 'line2.\n', 'line3.']
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
matchingsplit-0.1.2.tar.gz
(4.8 kB
view details)
Built Distribution
File details
Details for the file matchingsplit-0.1.2.tar.gz
.
File metadata
- Download URL: matchingsplit-0.1.2.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be93789fcfddd9602711406853d114f825dc67bd025ab2a6130c97b573532a24 |
|
MD5 | bbe9f07b9ca72e6fbacd25426b15a681 |
|
BLAKE2b-256 | 53cf583b5c9c1fc7a31936d357d4ca0709385fa240a07acb0b9b49a0362693df |
File details
Details for the file matchingsplit-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: matchingsplit-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58def0ac2c92a1003cb44ed8066b30e6a21a7bbefb48196202b8b6d358935f1c |
|
MD5 | afe9308b150f63cc50f905b15479e8b1 |
|
BLAKE2b-256 | 3b15794abbabf306400d72d3be2c33fc4de7c6c8a30de786d3acaad133a2f58b |