跳转到主要内容

通过匹配另一个类似的单词列表将字符串分割或将一组单词分组到列表中,以从实际剧本和不准确(生成)的副标题中创建准确副标题。

项目描述

matchingsplit

通过匹配另一个类似的单词列表将字符串分割或将一组单词分组到列表中,以从实际剧本和不准确(生成)的副标题中创建准确副标题。

示例

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.']

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于 安装软件包 的信息。

源代码分发

matchingsplit-0.1.2.tar.gz (4.8 kB 查看哈希值)

上传时间

构建分发

matchingsplit-0.1.2-py3-none-any.whl (4.0 kB 查看散列值)

上传于 Python 3

支持者