MCPcopy Create free account
hub / github.com/NatsUIJM/autoContents / extract_book_title

Function extract_book_title

mainprogress/content_postprocessor.py:37–42  ·  view source on GitHub ↗

从文件名中提取书名,取第一个下划线之前的内容

(filename: str)

Source from the content-addressed store, hash-verified

35
36
37def extract_book_title(filename: str) -> str:
38 """从文件名中提取书名,取第一个下划线之前的内容"""
39 match = re.match(r'^([^_]+)', filename)
40 if match:
41 return match.group(1)
42 return "booktitle"
43
44
45def find_min_page_file(json_files: list) -> str:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected