mirror of
https://github.com/HKUDS/LightRAG.git
synced 2025-12-08 21:37:24 +00:00
fix lint
This commit is contained in:
parent
f3c57b606e
commit
9e1be12e4a
@ -417,21 +417,21 @@ def extract_fixed_parenthesized_content(records: list[str]) -> list[str]:
|
||||
|
||||
for record in records:
|
||||
# First, extract properly matched pairs
|
||||
balanced_matches = re.findall(r'\((.*?)\)', record)
|
||||
balanced_matches = re.findall(r"\((.*?)\)", record)
|
||||
for match in balanced_matches:
|
||||
result.append(f"({match})")
|
||||
|
||||
|
||||
# Process string to handle unbalanced parentheses
|
||||
# For opening without closing
|
||||
open_matches = re.findall(r'\(([^()]*?)$', record)
|
||||
open_matches = re.findall(r"\(([^()]*?)$", record)
|
||||
for match in open_matches:
|
||||
result.append(f"({match})")
|
||||
|
||||
|
||||
# For closing without opening
|
||||
close_matches = re.findall(r'^([^()]*?)\)', record)
|
||||
close_matches = re.findall(r"^([^()]*?)\)", record)
|
||||
for match in close_matches:
|
||||
result.append(f"({match})")
|
||||
|
||||
|
||||
return result
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user