lunarflu HF staff commited on
Commit
5a7f0a3
·
verified ·
1 Parent(s): 676f51e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -128,6 +128,8 @@ def extract_adjacent_words(content, trigger, num_words=3):
128
  pattern = r'\b(\w+\s+){0,' + str(num_words) + '}' + r'\b' + r'\b'.join(map(re.escape, trigger)) + r'\b' + r'(\s+\w+){0,' + str(num_words) + '}\b'
129
  match = re.search(pattern, content, re.IGNORECASE)
130
  if match:
 
 
131
  return f"...{match.group(0)}..."
132
  return content
133
 
 
128
  pattern = r'\b(\w+\s+){0,' + str(num_words) + '}' + r'\b' + r'\b'.join(map(re.escape, trigger)) + r'\b' + r'(\s+\w+){0,' + str(num_words) + '}\b'
129
  match = re.search(pattern, content, re.IGNORECASE)
130
  if match:
131
+ f"----------------------------------------------------"
132
+ print(f"...{match.group(0)}...")
133
  return f"...{match.group(0)}..."
134
  return content
135