blueradiance commited on
Commit
8f37fc1
·
verified ·
1 Parent(s): a8d8849

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -19,10 +19,8 @@ def apply_name_tags(text: str, names: list, start_index: int = 100) -> tuple[str
19
 
20
  for name in names:
21
  tag = f"{TAG_PREFIX}{counter:03d}"
22
- pattern = re.compile(
23
- rf"([\s\(\[\"']*){re.escape(name)}([가-힣\s.,;:!?()\[\]\"']*)",
24
- re.IGNORECASE
25
- )
26
  tagged_text, n = pattern.subn(tag, tagged_text)
27
  if n > 0:
28
  mapping[tag] = name
 
19
 
20
  for name in names:
21
  tag = f"{TAG_PREFIX}{counter:03d}"
22
+ pattern = re.compile(rf"([\s\(\[\"']*){re.escape(kw)}([가-힣\s.,;:!?()\[\]\"']*)", re.IGNORECASE)
23
+
 
 
24
  tagged_text, n = pattern.subn(tag, tagged_text)
25
  if n > 0:
26
  mapping[tag] = name