raise KeyError("Intent not found in RegexIntentParser: %s"
% intent)
slots = []
for regex in self.regexes_per_intent[intent]:
match = regex.match(text)
if match is None:
continue
for group_name in match.groupdict():
slot_name = self.group_names_to_slot_names[group_name]
entity = self.slot_names_to_entities[slot_name]
rng = (match.start(group_name), match.end(group_name))
parsed_slot = ParsedSlot(match_range=rng,
value=match.group(group_name),
entity=entity,
After Change
raise KeyError("Intent not found in RegexIntentParser: %s"
% intent)
if text not in self._cache:
self._parse(text)
res = self._cache[text]
if intent is not None and res.parsed_intent is not None and \
res.parsed_intent.intent_name != intent:
return []