From 8c95209f1dce069a58930578b2980db5c70e3a54 Mon Sep 17 00:00:00 2001 From: Bobby Sudekum Date: Mon, 24 Jul 2017 12:51:43 -0700 Subject: [PATCH 1/4] Actively remove parens from voice instructions --- MapboxNavigation/String.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MapboxNavigation/String.swift b/MapboxNavigation/String.swift index dd63c5a049..47c7b2af8c 100644 --- a/MapboxNavigation/String.swift +++ b/MapboxNavigation/String.swift @@ -25,7 +25,9 @@ extension String { ("&", "&"), ("<", "<"), ("\"", """), - ("'", "'") + ("'", "'"), + ("(", " "), + (")", " ") ]) } } From 2351faad9fe0bbca31d5b9a68068268e1582176f Mon Sep 17 00:00:00 2001 From: Bobby Sudekum Date: Mon, 24 Jul 2017 13:01:58 -0700 Subject: [PATCH 2/4] No space --- MapboxNavigation/String.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MapboxNavigation/String.swift b/MapboxNavigation/String.swift index 47c7b2af8c..9cd1a2031b 100644 --- a/MapboxNavigation/String.swift +++ b/MapboxNavigation/String.swift @@ -26,8 +26,8 @@ extension String { ("<", "<"), ("\"", """), ("'", "'"), - ("(", " "), - (")", " ") + ("(", ""), + (")", "") ]) } } From ec2cedc634af4ef0a9476fc0308c273f0679b55c Mon Sep 17 00:00:00 2001 From: Bobby Sudekum Date: Tue, 25 Jul 2017 10:38:38 -0700 Subject: [PATCH 3/4] move to own func --- MapboxNavigation/RouteVoiceController.swift | 2 +- MapboxNavigation/String.swift | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/MapboxNavigation/RouteVoiceController.swift b/MapboxNavigation/RouteVoiceController.swift index d2089621f1..11f87b95d1 100644 --- a/MapboxNavigation/RouteVoiceController.swift +++ b/MapboxNavigation/RouteVoiceController.swift @@ -239,7 +239,7 @@ open class RouteVoiceController: NSObject, AVSpeechSynthesizerDelegate, AVAudioP text = upComingInstruction } - return text + return text.withoutPuncation } func localizeRoadDescription(_ step: RouteStep, markUpWithSSML: Bool) -> String { diff --git a/MapboxNavigation/String.swift b/MapboxNavigation/String.swift index 9cd1a2031b..a2585aa77b 100644 --- a/MapboxNavigation/String.swift +++ b/MapboxNavigation/String.swift @@ -25,9 +25,15 @@ extension String { ("&", "&"), ("<", "<"), ("\"", """), - ("'", "'"), + ("'", "'") + ]) + } + + var withoutPuncation: String { + return byReplacing([ ("(", ""), - (")", "") + (")", ""), + ("_", "") ]) } } From 9937c0bf80e91b2a6a7cc12d9de6277fbe1903fd Mon Sep 17 00:00:00 2001 From: Bobby Sudekum Date: Tue, 25 Jul 2017 15:14:34 -0700 Subject: [PATCH 4/4] Change name --- MapboxNavigation/RouteVoiceController.swift | 2 +- MapboxNavigation/String.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MapboxNavigation/RouteVoiceController.swift b/MapboxNavigation/RouteVoiceController.swift index 11f87b95d1..f3f0c7f3f8 100644 --- a/MapboxNavigation/RouteVoiceController.swift +++ b/MapboxNavigation/RouteVoiceController.swift @@ -239,7 +239,7 @@ open class RouteVoiceController: NSObject, AVSpeechSynthesizerDelegate, AVAudioP text = upComingInstruction } - return text.withoutPuncation + return text.removingPunctuation } func localizeRoadDescription(_ step: RouteStep, markUpWithSSML: Bool) -> String { diff --git a/MapboxNavigation/String.swift b/MapboxNavigation/String.swift index a2585aa77b..e08dc7d9ea 100644 --- a/MapboxNavigation/String.swift +++ b/MapboxNavigation/String.swift @@ -29,7 +29,7 @@ extension String { ]) } - var withoutPuncation: String { + var removingPunctuation: String { return byReplacing([ ("(", ""), (")", ""),