svoid dm_sayWithAutoLanguage_splitAtQuotes(S s) { LS parts = nempties(splitAt(s, "\"")); LS languages = replaceNullsWith('en, map dm_detectGermanVsEnglish(parts)); int i = 0; while (i < l(parts)) { int j = i; S lang = languages.get(i); while (j+1 < l(parts) && eq(lang, languages.get(j+1))) ++j; S part = joinWithSpace(subList(parts, i, j+1)); if (containsLetterOrDigit(part)) if (eq(lang, 'de)) dm_sayInGerman(part); else dm_sayInEnglish(part); i = j+1; } }
Began life as a copy of #1021145
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1021148 |
Snippet name: | dm_sayWithAutoLanguage_splitAtQuotes - use different languages for different parts |
Eternal ID of this version: | #1021148/2 |
Text MD5: | e083aaf6c8256862991c054bf04605af |
Author: | stefan |
Category: | javax / speech |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-01-23 23:48:58 |
Source code size: | 511 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 287 / 334 |
Version history: | 1 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |