Merge pull request #2126 from MycroftAI/bugfix/no_split_at_initials
Remove additional space after initialspull/2128/head
commit
5e7a4684cf
|
@ -76,6 +76,11 @@ def handle_speak(event):
|
|||
# so we likely will want to get rid of this when not running on Mimic
|
||||
if (config.get('enclosure', {}).get('platform') != "picroft" and
|
||||
len(re.findall('<[^>]*>', utterance)) == 0):
|
||||
# Remove any whitespace present after the period,
|
||||
# if a character (only alpha) ends with a period
|
||||
# ex: A. Lincoln -> A.Lincoln
|
||||
# so that we don't split at the period
|
||||
utterance = re.sub(r'\b([A-za-z][\.])(\s+)', r'\g<1>', utterance)
|
||||
chunks = re.split(r'(?<!\w\.\w.)(?<![A-Z][a-z]\.)(?<=\.|\;|\?)\s',
|
||||
utterance)
|
||||
for chunk in chunks:
|
||||
|
|
Loading…
Reference in New Issue