lunarflu HF staff commited on
Commit
8fec8ef
1 Parent(s): e4f9732

adjust pattern (word boundaries)

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -96,7 +96,7 @@ async def on_message(message):
96
 
97
  def extract_adjacent_words(content, trigger):
98
  words = content.split()
99
- pattern = r'\b' + r'\b\s*\b'.join(map(re.escape, trigger)) + r'\b'
100
  regex = re.compile(pattern, re.IGNORECASE)
101
 
102
  match = regex.search(content)
 
96
 
97
  def extract_adjacent_words(content, trigger):
98
  words = content.split()
99
+ pattern = r'\s*\b'.join(map(re.escape, trigger))
100
  regex = re.compile(pattern, re.IGNORECASE)
101
 
102
  match = regex.search(content)