MCPcopy
hub / github.com/tickmao/Novel / is_usable_name

Function is_usable_name

scripts/clean.py:165–168  ·  view source on GitHub ↗

判断名称是否仍然可用,避免清洗后变空。

(text: str)

Source from the content-addressed store, hash-verified

163
164
165def is_usable_name(text: str) -> bool:
166 """判断名称是否仍然可用,避免清洗后变空。"""
167 normalized = clean_spaces(text)
168 return len(normalized) >= 2 and bool(MEANINGFUL_NAME.search(normalized))
169
170
171def apply_if_usable(text: str, pattern: re.Pattern, replacement: str = "") -> str:

Callers 2

apply_if_usableFunction · 0.85
normalize_source_nameFunction · 0.85

Calls 1

clean_spacesFunction · 0.85

Tested by

no test coverage detected