@gentbajko/slopify 3.22.0 → 3.22.1
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.
|
@@ -7,7 +7,10 @@ import { cardinal, numberForms } from "../../kernel/ports/number-words.js";
|
|
|
7
7
|
// `formsOf` is the language's normaliser (`multilingual.ts` passes its own); the default is
|
|
8
8
|
// English, and `empty` is the sentence for a text with nothing to say.
|
|
9
9
|
export function speechWords(text, observed = "", aliases = [], formsOf = wordForms, empty = "Local subtitles currently require an English transcript with spoken words.") {
|
|
10
|
-
|
|
10
|
+
// An alias spoken as IPA ("Gygax's" said /ˈɡaɪɡæksɪz/) is a pronunciation, not other
|
|
11
|
+
// words: like a glossary entry, the recording is matched against the written word.
|
|
12
|
+
const worded = aliases.filter((alias) => !spokenAsIpa(alias.spoken));
|
|
13
|
+
const matches = worded.length === 0 ? [] : aliasMatches(text, worded);
|
|
11
14
|
const words = [];
|
|
12
15
|
for (const token of text.matchAll(/\S+/g)) {
|
|
13
16
|
const textWord = token[0];
|
|
@@ -57,6 +60,9 @@ export function speechWords(text, observed = "", aliases = [], formsOf = wordFor
|
|
|
57
60
|
// the written text again without the aliases, and "&" alone says nothing.
|
|
58
61
|
return words.map(({ text: shown, spoken, forms, aliased }) => forms.length > 1 || aliased ? { text: shown, spoken, forms } : { text: shown, spoken });
|
|
59
62
|
}
|
|
63
|
+
function spokenAsIpa(spoken) {
|
|
64
|
+
return /^\/[^/]+\/(?:\s+\/[^/]+\/)*$/u.test(spoken.trim());
|
|
65
|
+
}
|
|
60
66
|
// The form of a word the recording seems to say, else its default.
|
|
61
67
|
export function respoken(word, observed, formsOf = wordForms) {
|
|
62
68
|
if (word.forms === undefined)
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Slopify 3.22.1
|
|
2
|
+
|
|
3
|
+
Released 13 October 2026.
|
|
4
|
+
|
|
5
|
+
- **Subtitles work with a pronunciation alias.** A narration alias spoken as IPA (for example "Gygax's" said /ˈɡaɪɡæksɪz/) stopped the subtitles with "Local subtitles currently support English speech and Latin-script names only." Subtitles now time that word from its written form, the same way they do for a Pronunciation Glossary entry.
|
|
6
|
+
|
|
7
|
+
## Upgrading from 3.22.0
|
|
8
|
+
|
|
9
|
+
- A run stopped by that message goes on with Try again; nothing is voiced again.
|