Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
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 |
|