Skip to content

Commit

Permalink
Update: regex fix
Browse files Browse the repository at this point in the history
  • Loading branch information
patham9 committed Dec 31, 2020
1 parent d43f37a commit ab6deab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion english_to_narsese.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def isCommand(sentence):
def output(negated, text, replaceQuestionWords=True, command=False):
if replaceQuestionWords:
for x in questionwords:
text = re.sub(r'[^\W]'+text+"[^\W]", '?1', text)
text = re.sub(r'([^a-zA-Z0-9])(' + x + r')([^a-zA-Z0-9])', r'\1?1\3', text)
if command or text.startswith("//"):
print(text) #direct print
else:
Expand Down

0 comments on commit ab6deab

Please sign in to comment.