1 | svoid dm_sayWithAutoLanguage_splitAtQuotes(S s) { |
2 | LS parts = nempties(splitAt(s, "\"")); |
3 | LS languages = replaceNullsWith('en, map dm_detectGermanVsEnglish(parts)); |
4 | int i = 0; |
5 | while (i < l(parts)) { |
6 | int j = i; |
7 | S lang = languages.get(i); |
8 | while (j+1 < l(parts) && eq(lang, languages.get(j+1))) ++j; |
9 | S part = joinWithSpace(subList(parts, i, j+1)); |
10 | if (containsLetterOrDigit(part)) |
11 | if (eq(lang, 'de)) dm_sayInGerman(part); else dm_sayInEnglish(part); |
12 | i = j+1; |
13 | } |
14 | } |
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: | 288 / 335 |
Version history: | 1 change(s) |
Referenced in: | [show references] |