clavarium 0.2.224-next.1 → 0.2.225-next.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.
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/server/voice.mjs +6 -1
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.225-next.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "clavarium",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.225-next.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/package.json
CHANGED
package/server/voice.mjs
CHANGED
|
@@ -85,10 +85,15 @@ const PHANTOMS = [
|
|
|
85
85
|
/^\s*(?:thank(?:s| you) (?:so much )?for watching[.!,]?\s*(?:(?:and )?see you (?:in the |on the )?next (?:video|time)[.!]?)?|see you (?:in the )?next (?:video|time)[.!]?|merci d'avoir regardé(?: cette vidéo)?\s*[.!]?(?:\s*[àa] bient[ôo]t[.!]?)?)\s*$/giu,
|
|
86
86
|
/untertitel(?:ung)?\s+(?:im\s+auftrag\s+)?des\s+zdf(?:\s+für\s+funk)?,?\s*\d{0,4}[.!]?/giu,
|
|
87
87
|
];
|
|
88
|
+
/* Chinese, Japanese or Korean mixed into Latin words: written on a room's silence (01-11: « Sous 谢谢 大家 »);
|
|
89
|
+
a sentence wholly in one of them is kept. And the « Sous » its credits leave behind, when it is all. */
|
|
90
|
+
const FOREIGN_SCRIPT = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]+/gu;
|
|
88
91
|
export function withoutPhantoms(text) {
|
|
89
92
|
let t = text;
|
|
90
93
|
for (const re of PHANTOMS) t = t.replace(re, ' ');
|
|
91
|
-
|
|
94
|
+
if (/\p{Script=Latin}/u.test(t)) t = t.replace(FOREIGN_SCRIPT, ' ');
|
|
95
|
+
t = t.replace(/\s+/gu, ' ').trim();
|
|
96
|
+
return /^sous[.!,…]*$/iu.test(t) ? '' : t;
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
/* SPEECH HAS A SPEED: nobody says more than ~25 characters a second. More
|