HomePhabricator

Highlight recited sentence

Description

Highlight recited sentence

Added highlighting to the sentence that is currently being recited,
using span elements. The highlighting visuals can be changed by
overriding .ext-wikispeech-highlight-sentence. The default value is
defined in modules/ext.wikispeech.css. All text nodes used to generate
the utterance is wrapped in spans, except for the first and last. For
the latter, only the range of the node which is used in the utterance
is wrapped.

A path attribute was introduced to make the connection from an
utterance to the text nodes that were used to generate it. In doing
this, it was discovered that the position attributes previously added
to both utterances and tokens, aren't used in this solution. They were
therefore removed. This also allowed the removal of some
functionality, that was added for positions to work.

With the introduction of text elements, CleanedTag was renamed
CleanedContent and CleanedText was added. All the types of tags
(start-, end- and empty-) are now represented by the same class,
CleanedTag.

Tests were changed a bit to have less overlap in what's being tested
and to make them easier to work with.

Bug: T148622
Change-Id: I12c8873265b7236c0677b25ce089bbb887ffdd9c

Details

Provenance
Sebastian_Berlin-WMSEAuthored on Feb 9 2017, 3:33 PM
Parents
rEWIS46f0ef09afd7: Use PageContentLanguage in requests
Branches
Unknown
Tags
Unknown
ChangeId
I12c8873265b7236c0677b25ce089bbb887ffdd9c