Better handle punctuation inside words like email addresses, urls, file paths, etc.
This commit is contained in:
1 parent
7c53cb39d4
commit
7df1fa3ecb
4 files changed
+101
-7
No files matched your search
@@ -45,6 +45,27 @@ func TestSharedSpeechPunctuationAndPreparedCharacterFeedback(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestURLSpeechKeepsEmbeddedPunctuationAndOriginalClipboardText(t *testing.T) {
|
||||
processor, _, err := punctuation.Load([]string{"../../config/punctuation/default.toml"})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, substitutions := range []bool{false, true} {
|
||||
settings := config.Defaults()
|
||||
settings.Reading.Emoticons = substitutions
|
||||
settings.Reading.RepeatedSymbols = substitutions
|
||||
voice := &fakeVoice{}
|
||||
echo := &echoSpeaker{Speaker: voice, punctuation: processor, punctuationLevel: "some", settings: &settings}
|
||||
echo.Say("https://stormux.org")
|
||||
if !reflect.DeepEqual(voice.messages, []string{"https colon: slash slash stormux dot. org"}) {
|
||||
t.Fatal("URL speech lost punctuation", substitutions, voice.messages)
|
||||
}
|
||||
if echo.last != "https://stormux.org" {
|
||||
t.Fatal("clipboard echo lost original URL", echo.last)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestReviewCharactersUseProfileRegardlessOfLevelAndKeepBoundaries(t *testing.T) {
|
||||
processor, _, err := punctuation.Load([]string{"../../config/punctuation/fr.toml"})
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user