Fixed bug where punctuation was skipped when occuring inside numbers. Also removed the end of sentence pause marker for punctuation inside words/numbers.
This commit is contained in:
1 parent
22f6df6af9
commit
36736725ea
4 files changed
+85
-26
No files matched your search
@@ -45,7 +45,7 @@ func TestSharedSpeechPunctuationAndPreparedCharacterFeedback(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestURLSpeechKeepsEmbeddedPunctuationAndOriginalClipboardText(t *testing.T) {
|
||||
func TestSpeechKeepsEmbeddedPunctuationAndOriginalClipboardText(t *testing.T) {
|
||||
processor, _, err := punctuation.Load([]string{"../../config/punctuation/default.toml"})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -56,12 +56,19 @@ func TestURLSpeechKeepsEmbeddedPunctuationAndOriginalClipboardText(t *testing.T)
|
||||
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)
|
||||
for _, trial := range []struct{ input, want string }{
|
||||
{"https://stormux.org", "https colon slash slash stormux dot org"},
|
||||
{"2026.10.31", "2026 dot 10 dot 31"},
|
||||
{"3.14", "3.14"},
|
||||
} {
|
||||
voice.messages = nil
|
||||
echo.Say(trial.input)
|
||||
if !reflect.DeepEqual(voice.messages, []string{trial.want}) {
|
||||
t.Fatal("speech lost punctuation", trial.input, substitutions, voice.messages)
|
||||
}
|
||||
if echo.last != trial.input {
|
||||
t.Fatal("clipboard echo lost original text", echo.last)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user