Skip to content

Commit

Permalink
Actively remove parens from voice instructions (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobby Sudekum committed Jul 25, 2017
1 parent 1840f48 commit 44957cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion MapboxNavigation/RouteVoiceController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ open class RouteVoiceController: NSObject, AVSpeechSynthesizerDelegate, AVAudioP
text = upComingInstruction
}

return text
return text.removingPunctuation
}

func speak(_ text: String, error: String? = nil) {
Expand Down
8 changes: 8 additions & 0 deletions MapboxNavigation/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,12 @@ extension String {
("'", "'")
])
}

var removingPunctuation: String {
return byReplacing([
("(", ""),
(")", ""),
("_", "")
])
}
}

0 comments on commit 44957cb

Please sign in to comment.