@readium/speech 0.9.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -11
- package/build/gnd/converter.d.ts +3 -0
- package/build/gnd/domRangeGenerator.d.ts +1 -1
- package/build/gnd/object.d.ts +4 -0
- package/build/gnd/options.d.ts +2 -0
- package/build/gnd/selectorGenerator.d.ts +3 -2
- package/build/gnd/textrefFragment.d.ts +2 -0
- package/build/index.cjs +17 -43
- package/build/index.js +4983 -5321
- package/build/preferences/SpeechDefaults.d.ts +4 -1
- package/build/preferences/SpeechPreferences.d.ts +3 -2
- package/build/preferences/SpeechPreferencesEditor.d.ts +3 -1
- package/build/preferences/SpeechSettings.d.ts +3 -1
- package/build/preferences/constraints.d.ts +3 -1
- package/build/preferences/index.d.ts +2 -1
- package/build/speechNavigator.d.ts +8 -0
- package/build/utils/text.d.ts +3 -0
- package/build/utterance.d.ts +6 -1
- package/build/utterances/applySubstitutions.d.ts +3 -0
- package/build/utterances/boundaryLocate.d.ts +11 -0
- package/build/utterances/builtInSubstitutions.d.ts +2 -0
- package/build/utterances/builtInSuppressions.d.ts +1 -0
- package/build/utterances/contextualization.d.ts +15 -0
- package/build/utterances/extractUtterances.d.ts +3 -1
- package/build/utterances/index.d.ts +4 -1
- package/build/utterances/locate.d.ts +22 -0
- package/build/utterances/mergeUtterances.d.ts +17 -0
- package/build/utterances/sentenceBoundaryMerge.d.ts +7 -0
- package/build/utterances/sentenceReconstruction.d.ts +6 -0
- package/build/utterances/sentenceSegmenter.d.ts +8 -0
- package/build/utterances/splitSsmlAtSentences.d.ts +2 -0
- package/build/utterances/text.d.ts +29 -0
- package/build/utterances/types.d.ts +18 -2
- package/build/utterances/utteranceLocate.d.ts +4 -0
- package/build/utterances/utteranceOutput.d.ts +6 -0
- package/build/utterances/walk.d.ts +4 -0
- package/build/utterances/walkContext.d.ts +40 -0
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -40,7 +40,17 @@ We are now on the sixth phase: verbosity and prosody, in particular contextualiz
|
|
|
40
40
|
|
|
41
41
|
## Demos
|
|
42
42
|
|
|
43
|
-
### [
|
|
43
|
+
### [In-context demo](https://readium.org/speech/demo)
|
|
44
|
+
|
|
45
|
+
In-context reading with seamless voice selection (grouped by region and sorted based on quality), and playback control, providing an optional read-along experience that integrates naturally with the content.
|
|
46
|
+
|
|
47
|
+
A scenario picker switches between sample documents (a plain article, fixed-layout pages with cross-column sentences, word-level and letter-level positioned spans, combined FXL patterns, and Unicode look-alikes/ASCII imitations), each exercising a different extraction path.
|
|
48
|
+
|
|
49
|
+
Settings include a verbosity selector (none/few/some/most) demonstrating [contextualization](docs/Preferences.md) — synthesized announcements spoken around content based on its role (entering/leaving a section, a footnote, a pullquote…) — a segmentation mode (structure/sentence), playback speed, and, for the read-along experience, independent highlight styles (highlight, underline, strikethrough, outline, text color, mask) and colors for the current utterance and the current word.
|
|
50
|
+
|
|
51
|
+
A side panel shows the [Guided Navigation](docs/GuidedNavigation.md) object and the [utterances](docs/UtteranceExtraction.md) extracted from the current scenario, live, synced to playback as it progresses.
|
|
52
|
+
|
|
53
|
+
### [Voice selection with playback demo](https://readium.org/speech/demo/voice-selection)
|
|
44
54
|
|
|
45
55
|
- fetching a list of all available languages, translating them to the user's locale and sorting them based on these translations
|
|
46
56
|
- returning a list of voices for a given language, grouped by region and sorted based on quality
|
|
@@ -49,14 +59,6 @@ We are now on the sixth phase: verbosity and prosody, in particular contextualiz
|
|
|
49
59
|
- using the current Navigator for playback control
|
|
50
60
|
- highlighting: as playback progresses, the current word/sentence is highlighted
|
|
51
61
|
|
|
52
|
-
### [In-context demo](https://readium.org/speech/demo/article)
|
|
53
|
-
|
|
54
|
-
In-context reading with seamless voice selection (grouped by region and sorted based on quality), and playback control, providing an optional read-along experience that integrates naturally with the content.
|
|
55
|
-
|
|
56
|
-
Settings include a verbosity selector (none/few/some/most) demonstrating [contextualization](docs/Preferences.md) — synthesized announcements spoken around content based on its role (entering/leaving a section, a footnote, a pullquote…) — and, for the read-along experience, independent highlight styles (highlight, underline, strikethrough, outline, text color, mask) and colors for the current utterance and the current word.
|
|
57
|
-
|
|
58
|
-
The panel alongside the article shows the [Guided Navigation](docs/GuidedNavigation.md) object and the [utterances](docs/UtteranceExtraction.md) extracted from it, live.
|
|
59
|
-
|
|
60
62
|
### [Extraction playground](https://readium.org/speech/demo/playground)
|
|
61
63
|
|
|
62
64
|
Pick a sample piece of markup and watch it move through the whole pipeline:
|
|
@@ -182,8 +184,8 @@ The project includes demo applications that can be served locally:
|
|
|
182
184
|
```
|
|
183
185
|
|
|
184
186
|
2. Open your browser to:
|
|
185
|
-
- [
|
|
186
|
-
- [
|
|
187
|
+
- [In-context reading demo](http://localhost:8080/demo)
|
|
188
|
+
- [Voice selection demo](http://localhost:8080/demo/voice-selection)
|
|
187
189
|
- [Extraction playground](http://localhost:8080/demo/playground)
|
|
188
190
|
|
|
189
191
|
### ChromeOS Debugging
|
package/build/gnd/converter.d.ts
CHANGED
|
@@ -14,7 +14,10 @@ export declare class Converter {
|
|
|
14
14
|
selectorPredicate: ((roles: GndRole[]) => boolean) | null;
|
|
15
15
|
domRangeEnabled: boolean;
|
|
16
16
|
textFragmentEnabled: boolean;
|
|
17
|
+
leafTextEnabled: boolean;
|
|
17
18
|
docRoot: Document | null;
|
|
19
|
+
selectorRoot: Element | null;
|
|
20
|
+
selectorRootAnchor: string | null;
|
|
18
21
|
private root;
|
|
19
22
|
private current;
|
|
20
23
|
private foldedCaptions;
|
|
@@ -6,4 +6,4 @@ export interface KnownSelector {
|
|
|
6
6
|
export declare function generateDomRange(range: {
|
|
7
7
|
first: [Text, number];
|
|
8
8
|
last: [Text, number];
|
|
9
|
-
},
|
|
9
|
+
}, selectorRoot: Element | null, rootAnchor: string | null, known?: KnownSelector): DomRangeJSON | undefined;
|
package/build/gnd/object.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ export interface ObjBuilder {
|
|
|
11
11
|
children?: ObjBuilder[];
|
|
12
12
|
description?: string;
|
|
13
13
|
}
|
|
14
|
+
export declare const ariaSubstitutedBuilders: WeakSet<ObjBuilder>;
|
|
15
|
+
export declare const ariaSubstitutedNodes: WeakSet<GndObject>;
|
|
16
|
+
export declare const substitutedOwnSelectorBuilders: WeakMap<ObjBuilder, string>;
|
|
17
|
+
export declare const substitutedOwnSelectorNodes: WeakMap<GndObject, string>;
|
|
14
18
|
export declare function isEmptyObj(o: ObjBuilder): boolean;
|
|
15
19
|
/** A node being built up during the tree walk, before its final shape is known. */
|
|
16
20
|
export declare class NavObject {
|
package/build/gnd/options.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GndRole } from './types.js';
|
|
2
|
+
export declare const leafTextRoleKeyword = "leaf-text";
|
|
2
3
|
export interface TextrefOptions {
|
|
3
4
|
roles?: boolean | GndRole[];
|
|
4
5
|
domRange?: boolean;
|
|
@@ -9,6 +10,7 @@ export interface GndGenerationOptions {
|
|
|
9
10
|
}
|
|
10
11
|
export interface NormalizedTextrefOptions {
|
|
11
12
|
predicate: ((roles: GndRole[]) => boolean) | null;
|
|
13
|
+
leafText: boolean;
|
|
12
14
|
domRange: boolean;
|
|
13
15
|
textFragment: boolean;
|
|
14
16
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export declare function
|
|
2
|
-
export declare function
|
|
1
|
+
export declare function rootAnchorSelector(selectorRoot: Element | null): string | null;
|
|
2
|
+
export declare function selectorForElement(el: Element, selectorRoot: Element | null, rootAnchor: string | null): string | undefined;
|
|
3
|
+
export declare function textrefForSelector(selector: string | undefined, el: Element): string | undefined;
|
|
@@ -11,6 +11,7 @@ export interface DomRangeJSON {
|
|
|
11
11
|
textNodeIndex: number;
|
|
12
12
|
charOffset?: number;
|
|
13
13
|
};
|
|
14
|
+
container?: string;
|
|
14
15
|
}
|
|
15
16
|
export declare function encodeDomRangeFragment(domRange: DomRangeJSON): string;
|
|
16
17
|
export declare function decodeDomRangeFragment(textref: string | undefined): DomRangeJSON | undefined;
|
|
@@ -32,6 +33,7 @@ export interface DecodedTextref {
|
|
|
32
33
|
};
|
|
33
34
|
fragment?: string;
|
|
34
35
|
}
|
|
36
|
+
export declare function combineDomRangeTextrefs(first: DecodedTextref, last: DecodedTextref): DecodedTextref | undefined;
|
|
35
37
|
export declare function decodeTextref(node: {
|
|
36
38
|
id?: string;
|
|
37
39
|
textref?: string;
|