Discussion:
Fixing spelling spaces
Samuel Thibault
2017-03-14 22:59:36 UTC
Permalink
Hello William,

Could you commit this to the espeakup repository?


Fix spelling spaces

espeak doesn't speak spaces unless strongly being told to do so :)

--- a/espeak.c
+++ b/espeak.c
@@ -170,9 +170,13 @@ static espeak_ERROR speak_text(struct sy
if (espeakup_mode == ESPEAKUP_MODE_SPEAKUP && (s->len == 1)) {
char *buf;
int n;
- n = asprintf(&buf,
- "<say-as interpret-as=\"characters\">%c</say-as>",
- s->buf[0]);
+ if (s->buf[0] == ' ')
+ n = asprintf(&buf,
+ "<say-as interpret-as=\"tts:char\">&#32;</say-as>");
+ else
+ n = asprintf(&buf,
+ "<say-as interpret-as=\"characters\">%c</say-as>",
+ s->buf[0]);
if (n == -1) {
/* D'oh. Not much to do on allocation failure.
* Perhaps espeak will happen to say the character */
Zahari Yurukov
2017-03-17 01:06:48 UTC
Permalink
Hi Samuel,
There's one problem with this when spelling capital letters:
The capital letter is surrounded by spaces, which are now spoken.
For example, capital S is pronounced:
space S space
Or actually, that are \0 characters, as far as I can see.
Perhaps espeak Treats all white space as... space?
That actually could be true, cause I hear "space" alot now.
--
Best wishes,
Zahari
Samuel Thibault
2017-03-19 16:12:30 UTC
Permalink
Hello,
Post by Zahari Yurukov
The capital letter is surrounded by spaces, which are now spoken.
space S space
Which command produces this effect? I'm not getting a "space" spoken
with espeakup.
Post by Zahari Yurukov
Or actually, that are \0 characters, as far as I can see.
How do you see this?
Post by Zahari Yurukov
Perhaps espeak Treats all white space as... space?
Well, yes, espeakup can't know whether a space given by the kernel is to
be pronounced or not. If there are spaces which should not be spoken,
the kernel should just not send them to espeakup.
Post by Zahari Yurukov
That actually could be true, cause I hear "space" alot now.
In which situations exactly?

Samuel
Zahari Yurukov
2017-03-19 17:38:39 UTC
Permalink
Hi,

Samuel Thibault wrote:
Sun, Mar 19, 2017 at 05:12:30PM +0100
Post by Samuel Thibault
Which command produces this effect? I'm not getting a "space" spoken
with espeakup.
This is the say character review commands and is only for latin characters with
direct mode disabled, actually.
Post by Samuel Thibault
How do you see this?
I thought it's from main.c:
char spk_str_caps_start[MAXVARLEN + 1] = "\0";
char spk_str_caps_stop[MAXVARLEN + 1] = "\0";
But I could be wrong, actually.
For example, in main.c, I see this line in several places:
synth_buffer_add(SPACE);
Namely in speak_char and in spkup_write.
Post by Samuel Thibault
In which situations exactly?
In addition to "character, say previous/current/next", also with "Say screen" command.
Also when moving the cursor with the arrow keys over capital letter and when pressing Enter in bash.
--
Best wishes,
Zahari
Samuel Thibault
2017-03-19 21:28:27 UTC
Permalink
Hello,
Post by Zahari Yurukov
Post by Samuel Thibault
Which command produces this effect? I'm not getting a "space" spoken
with espeakup.
This is the say character review commands and is only for latin characters with
direct mode disabled, actually.
Ah without direct mode, ok, now I get them.
Post by Zahari Yurukov
Post by Samuel Thibault
How do you see this?
char spk_str_caps_start[MAXVARLEN + 1] = "\0";
char spk_str_caps_stop[MAXVARLEN + 1] = "\0";
These strings are actually bogus: "\0" boils down to "" here.
Post by Zahari Yurukov
synth_buffer_add(SPACE);
Namely in speak_char and in spkup_write.
Ok, the culprit is not really them, but that synth_printf just after
that flushes the synth, and thus the synth is explicitly given the space
alone.
Post by Zahari Yurukov
Post by Samuel Thibault
In which situations exactly?
In addition to "character, say previous/current/next", also with "Say screen" command.
Also when moving the cursor with the arrow keys over capital letter and when pressing Enter in bash.
Ok, I believe the attached patch should fix all of them by grouping the
writes into just one go?

Samue
Zahari Yurukov
2017-03-19 22:19:05 UTC
Permalink
Hi Samuel,

Samuel Thibault wrote:
Sun, Mar 19, 2017 at 10:28:27PM +0100
Post by Samuel Thibault
Ok, I believe the attached patch should fix all of them by grouping the
writes into just one go?
Unfortunately it didn't. I get spaces just by pressing a capital letter, i. e. Shift+letter.
If i cursor over a capital letter in vim - I get spaces, too.

The patch applyed cleanly, I did `make clean` before compiling...
--
Best wishes,
Zahari
Samuel Thibault
2017-03-20 01:01:36 UTC
Permalink
Post by Zahari Yurukov
Sun, Mar 19, 2017 at 10:28:27PM +0100
Post by Samuel Thibault
Ok, I believe the attached patch should fix all of them by grouping the
writes into just one go?
Unfortunately it didn't. I get spaces just by pressing a capital letter, i. e. Shift+letter.
If i cursor over a capital letter in vim - I get spaces, too.
Oops, sorry, it seems I tested it wrongly, here is a proper fix.

Samuel
Zahari Yurukov
2017-03-20 13:44:48 UTC
Permalink
Hi,

Samuel Thibault wrote:
Mon, Mar 20, 2017 at 02:01:36AM +0100
Post by Samuel Thibault
here is a proper fix.
Yes, this removes the spaces around capital letters.
Thank you very much! That was super annoying bug.

It looks like though that doesn't get rid of all the extra spaces, i. e. when pressing Enter in bash..
I'm not sure that's exactly a bug, or if it could be prevented without
some hack, but it makes impression - it was noticed on the Vinux support
mailing list.

Say from top, Say to bottom or Say screen commands
are OK - spaces are read only on maximum punctuation, which I think is
desirable. Actually, I might have made a mistake about them, misled by
the punctuation level, though I don't remember how it was exactly
before the espeakup patch.

I'll write if something else pops up.
--
Best wishes,
Zahari
Samuel Thibault
2017-03-21 00:30:28 UTC
Permalink
Hello,
Post by Zahari Yurukov
It looks like though that doesn't get rid of all the extra spaces, i. e. when pressing Enter in bash..
I don't manage to reproduce this. What does your $PS1 look like? I guess
by "pressing Enter in bash", you mean pressing enter without entering
anything before, i.e. an empty command?

Samuel
Zahari Yurukov
2017-03-21 10:49:59 UTC
Permalink
Hi,

Samuel Thibault wrote:
Tue, Mar 21, 2017 at 01:30:28AM +0100
Post by Samuel Thibault
I don't manage to reproduce this. What does your $PS1 look like? I guess
by "pressing Enter in bash", you mean pressing enter without entering
anything before, i.e. an empty command?
Yes, an empty command.
PS1 is:
${debian_chroot:+($debian_chroot)}\u@\h:\w\$
I guess this is an artifact from my bashrc from Vinux, since I'm using Fedora.
But I can reproduce it even with the default:
\s-\v\$
The other person who can reproduce it is also using Fedora.

Actually, now as I listen carefully, I hear "space" even if the command
is not empty, i. e. if I type:
ls<enter>
--
Best wishes,
Zahari
Samuel Thibault
2017-03-21 22:22:45 UTC
Permalink
Hello,
Post by Zahari Yurukov
Post by Samuel Thibault
I don't manage to reproduce this. What does your $PS1 look like? I guess
by "pressing Enter in bash", you mean pressing enter without entering
anything before, i.e. an empty command?
Yes, an empty command.
I guess this is an artifact from my bashrc from Vinux, since I'm using Fedora.
\s-\v\$
Ok. Do you have any speakup personalization?
(i.e. you have direct = 0, anything else?)

Samuel
Zahari Yurukov
2017-03-22 15:28:01 UTC
Permalink
Hi,

Samuel Thibault wrote:
Tue, Mar 21, 2017 at 11:22:45PM +0100
Post by Samuel Thibault
Ok. Do you have any speakup personalization?
(i.e. you have direct = 0, anything else?)
Actually, I hear the "space" even with direct = 1.
Here's what I have at this moment:

attrib_bleep 1
bell_pos 0
bleeps 3
bleep_time 30
cursor_time 120
delimiters
ex_num
key_echo 1
no_interrupt 0
punc_all !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
punc_level 0
punc_most
#$%&()*+/<=>@\^|punc_some
$%&/@reading_punc 0
repeats
()say_control 0
say_word_ctl 0
spell_delay 0
synth soft
soft/caps_start "\x01+3p"
soft/caps_stop "\x01-3p"
soft/delay_time 0
soft/direct 1
soft/freq 5
soft/full_time 0
soft/jiffy_delta 0
soft/pitch 5
soft/punct 0
soft/rate 6
soft/tone 1
soft/trigger_time 0
soft/voice 0
soft/vol 9
--
Best wishes,
Zahari
Samuel Thibault
2017-03-23 00:39:31 UTC
Permalink
Post by Zahari Yurukov
Post by Samuel Thibault
Ok. Do you have any speakup personalization?
(i.e. you have direct = 0, anything else?)
Actually, I hear the "space" even with direct = 1.
Uh. I really don't manage to reproduce it.

When is "space" pronounced actually? Before the prompt speech or after
the prompt speech?

Samuel
Zahari Yurukov
2017-03-23 09:56:01 UTC
Permalink
Hi,
Attach: /tmp/softsynthu.dump

Samuel Thibault wrote:
Thu, Mar 23, 2017 at 01:39:31AM +0100
Post by Samuel Thibault
When is "space" pronounced actually? Before the prompt speech or after
the prompt speech?
Before the prompt speech.
I'll attach a dump of /dev/softsynthu where I do couple of empty
commands, then `ls /speakup`, then another couple of empty commands.
--
Best wishes,
Zahari
Zahari Yurukov
2017-03-23 09:58:50 UTC
Permalink
Sorry for the missing attachment in the previous letter.
--
Best wishes,
Zahari

Zahari Yurukov wrote:
Thu, Mar 23, 2017 at 11:56:01AM +0200
Post by Zahari Yurukov
Hi,
Attach: /tmp/softsynthu.dump
Thu, Mar 23, 2017 at 01:39:31AM +0100
Post by Samuel Thibault
When is "space" pronounced actually? Before the prompt speech or after
the prompt speech?
Before the prompt speech.
I'll attach a dump of /dev/softsynthu where I do couple of empty
commands, then `ls /speakup`, then another couple of empty commands.
--
Best wishes,
Zahari
Samuel Thibault
2017-03-26 20:50:17 UTC
Permalink
Hello,
Post by Zahari Yurukov
Sorry for the missing attachment in the previous letter.
It seems the attachment is still not there. Perhaps the speakup mailing
list drops attachments? You should then explicitly Cc me so I get the
mail directly.

Samuel
Zahari Yurukov
2017-03-31 21:31:46 UTC
Permalink
Hi,

Samuel Thibault wrote:
Sun, Mar 26, 2017 at 10:50:17PM +0200
Post by Samuel Thibault
It seems the attachment is still not there. Perhaps the speakup mailing
list drops attachments? You should then explicitly Cc me so I get the
mail directly.
Or may be I must have forgot to change the permission of the file to be
readable by my normal user, though I'm sure I've checked the send copy
and it was there. I'm sending you a carbon copy now.
By the way I did:
cat /dev/softsynthu > /tmp/softsynthu.dump
And then I did a couple of Enter presses and "ls /speakup", in which
situation with espeakup I always get "space" pronounced immediately
after pressing Enter.
Is there a better way to show you what output I get?
--
Best wishes,
Zahari
Loading...