Commit 1c31986e authored by Akihiro Ota's avatar Akihiro Ota Committed by Commit Bot

ChromeVox: Repeated characters of 2 or less should not be summarized.

Bug: 1051951
Change-Id: I15a292404566c71ad1a508bf9e03ff0dd96fffd4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2056747
Commit-Queue: Akihiro Ota <akihiroota@chromium.org>
Reviewed-by: default avatarAkihiro Ota <akihiroota@chromium.org>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742890}
parent c4f0d091
......@@ -519,4 +519,4 @@ AbstractTts.substitutionDictionaryRegexp_;
* @private
*/
AbstractTts.repetitionRegexp_ =
/([-\/\\|!@#$%^&*\(\)=_+\[\]\{\}.?;'":<>\u2022])\1{1,}/g;
/([-\/\\|!@#$%^&*\(\)=_+\[\]\{\}.?;'":<>\u2022])\1{2,}/g;
......@@ -30,12 +30,22 @@ SYNC_TEST_F('ChromeVoxTtsBackgroundTest', 'Preprocess', function() {
assertEquals('a.', preprocess('a.'));
assertEquals('.a', preprocess('.a'));
// Only summarize punctuation if there are three or more occurrences without
// a space in between.
assertEquals('10 equal signs', preprocess('=========='));
assertEquals('bullet bullet bullet', preprocess('\u2022 \u2022\u2022'));
assertEquals('3 bullets', preprocess('\u2022\u2022\u2022'));
assertEquals('C plus plus', preprocess('C++'));
assertEquals('C 3 plus signs', preprocess('C+++'));
// There are some punctuation marks that we do not verbalize because they
// result in an overly verbose experience (periods, commas, dashes, etc.).
// This set of punctuation marks is defined in the |some_punctuation| regular
// expression in TtsBackground.
assertEquals('C--', preprocess('C--'));
assertEquals('Hello world.', preprocess('Hello world.'));
assertEquals('new line', preprocess('\n'));
assertEquals('return', preprocess('\r'));
assertEquals('bullet 2 bullets', preprocess('\u2022 \u2022\u2022'));
});
TEST_F('ChromeVoxTtsBackgroundTest', 'UpdateVoice', function() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment