bugfix/adapt munging

pull/2303/head
jarbasal 2019-09-13 02:06:18 +01:00
parent 8fb27e656d
commit 5edf464808
1 changed files with 3 additions and 3 deletions

View File

@ -149,7 +149,7 @@ def munge_intent_parser(intent_parser, name, skill_id):
skill_id: (int) skill identifier
"""
# Munge parser name
if str(skill_id) + ':' not in name:
if not name.startswith(str(skill_id) + ':'):
intent_parser.name = str(skill_id) + ':' + name
else:
intent_parser.name = name
@ -159,7 +159,7 @@ def munge_intent_parser(intent_parser, name, skill_id):
# Munge required keyword
reqs = []
for i in intent_parser.requires:
if skill_id not in i[0]:
if not i[0].startswith(skill_id):
kw = (skill_id + i[0], skill_id + i[0])
reqs.append(kw)
else:
@ -169,7 +169,7 @@ def munge_intent_parser(intent_parser, name, skill_id):
# Munge optional keywords
opts = []
for i in intent_parser.optional:
if skill_id not in i[0]:
if not i[0].startswith(skill_id):
kw = (skill_id + i[0], skill_id + i[0])
opts.append(kw)
else: