Juho Hiltunen
5f1a4f9cbd
Revert "maintainability: pass n_ph_list2 and ph_list2 to MakePhonemeList() and SubstitutePhonemes() instead of using globals"
...
This reverts commit f0c345eb6a .
Fixes #824 .
2020-12-30 12:02:02 +02:00
Juho Hiltunen
aafa55cbbc
code cleanup: remove unnecessary code related to LOPT_CAPS_IN_WORD
...
translate.h gives two settings to LOPT_CAPS_IN_WORD, but only one of them is actually ever used.
2020-12-28 11:30:08 +02:00
Juho Hiltunen
0352616de9
code cleanup: remove ununsed ctrl_embedded
...
It's a duplicate of CTRL_EMBEDDED.
2020-07-24 15:44:03 +03:00
Juho Hiltunen
ee944700f8
code cleanup: Check all local includes with include-what-you-use
...
Going through files in src/libespeak-ng/, include-what-you-use removed a
few unnecessary includes and included explanations on why a certain
header should be included. This makes tracking globals and dependencies easier.
Running the codebase through IWYU should be repeated after each major
code restIncludes to standard c library weren't checked to avoid
breaking builds with other platforms.
See https://github.com/include-what-you-use/include-what-you-use
2020-07-24 07:29:47 +03:00
BenTalagan
0d37ecbf94
Added additional tests in translate.c
2020-05-07 14:20:39 +02:00
Reece H. Dunn
4aaef4c3e0
Fix additional warnings with addPluralSuffixes.
2020-04-12 11:35:36 +01:00
Valdis Vitolins
f514bbcc8d
Fix 'implicit declaration of function ‘addPluralSuffixes’' C99/clang error
2020-04-12 12:37:23 +03:00
Valdis Vitolins
cf4809a1e5
Fix bug #706 : pronunciation error with abbreviations followed by 's
2020-04-10 22:55:58 +03:00
BenTalagan
9fd480afbf
Fixing typos and naming
2019-11-19 12:30:32 +01:00
BenTalagan
94677f4af8
Rule alignment fixes for non compliant platforms / Fix for emscripten demo
2019-11-19 09:54:11 +01:00
Reece H. Dunn
86bbc257b0
Support matching any length strings in the replacement rules.
2018-07-24 22:32:39 +01:00
Reece H. Dunn
98e9122dfc
FindReplacementChars: Pass in the source buffer (next characters) instead of next_in.
2018-07-24 22:04:12 +01:00
Reece H. Dunn
4fbcda9c2a
FindReplacementChars: Use an nc (next character) variable.
2018-07-24 22:00:25 +01:00
Reece H. Dunn
cacc212d4b
FindReplacementChars: Rename uc to fc.
2018-07-24 21:57:54 +01:00
Reece H. Dunn
a9d4bdd7f7
Make ignore_next into ignore_next_n to support ignoring multiple next characters.
2018-07-24 21:30:47 +01:00
Reece H. Dunn
252f5772ae
Simplify printing the replace message.
2018-07-23 22:28:09 +01:00
Reece H. Dunn
55c64036e0
Use UTF-8 strings in replace rules, instead of a packed UTF-16 pair.
2018-07-23 22:12:20 +01:00
Reece H. Dunn
424f705525
Revert the new (broken) replacement rule logic.
...
The replacement tests for bs, hr, and sr are no longer marked as
broken as they work using the old code. The mk tests keep the
broken annotation, as they don't work in the old code either.
This reverts commit 801a8d197c .
This reverts commit 64d5701e5e .
This reverts commit 3b51ebf617 .
This reverts commit 1fd235d2c0 .
This reverts commit 9f0667de86 .
2018-07-23 19:38:46 +01:00
Reece H. Dunn
801a8d197c
TranslateChars: Supress an unsigned to signed cast
2018-07-14 08:10:41 +01:00
Valdis Vitolins
64d5701e5e
Remove unused word_flags parameter
2018-07-09 20:33:37 +03:00
Valdis Vitolins
3b51ebf617
Remove previous implementation of .replace rule
2018-07-09 20:32:04 +03:00
Valdis Vitolins
9f0667de86
Part of issue #199 — extend .replace rule to allow using groups of characters
2018-07-09 20:27:51 +03:00
Reece H. Dunn
91744ac171
Fix gcc 7.3.0 warnings in translate.c.
2018-06-30 14:08:50 +01:00
Juho Hiltunen
bafc8e0f24
Emoji: skip multi-word replacements.
...
Fixes #511 .
2018-06-30 15:33:15 +03:00
Valdis Vitolins
18eeefca19
Improve comments for character translation
2018-05-31 00:05:39 +03:00
Valdis Vitolins
dc0165821f
Fix comments about conversion
2018-05-30 23:59:28 +03:00
Valdis Vitolins
bf3bb39fb0
Implementation for feature #489
...
When .replace rule is used and -X switch is passed in runtime,
replaced characters should be shown in trace output.
2018-05-30 23:56:11 +03:00
Reece H. Dunn
eb8ced46e3
Don't treat words without alpha characters (e.g. emoji) as upper case.
2018-04-30 07:09:28 +01:00
Juho Hiltunen
8904700ad3
remove unused wmark and all related code
2018-04-22 12:26:14 +03:00
Juho Hiltunen
cd35a6fd07
refactor setting tone_out in TranslateClause
2018-04-22 12:26:14 +03:00
Juho Hiltunen
b7c2ad604b
refactor and remove redundant call to towlower2()
2018-04-15 19:36:40 +03:00
Juho Hiltunen
f0c345eb6a
maintainability: pass n_ph_list2 and ph_list2 to MakePhonemeList() and SubstitutePhonemes() instead of using globals
2018-03-25 12:41:05 +03:00
Juho Hiltunen
b23e8a7269
maintainability: pass Translator as to towlower2() instead of using a global
2018-03-25 12:40:57 +03:00
Juho Hiltunen
f73ebfd126
maintainability: pass current_alphabet as argument to TranslateLetter() instead of using global
2018-03-24 15:05:53 +02:00
Juho Hiltunen
1bad240de8
maintainability: remove some unused variables and unnecessary extern declarations
2018-03-24 15:03:48 +02:00
Juho Hiltunen
c4ec7bfe34
remove option_phoneme_variants that is never set and always evaluates true
2018-03-24 15:03:12 +02:00
Juho Hiltunen
7ee0d7905c
remove unused int option_tone2
...
It is set in voices.c but never used. docs/voices.md indicates that the keyword intonation only takes one parameter, confirming that option_tone2 is unused.
2018-03-24 14:25:50 +02:00
Reece H. Dunn
2d7f3e9d54
Don't skip blanks past charix_top in TranslateClause.
2018-03-22 20:49:15 +00:00
Reece H. Dunn
879cb9c08a
Don't free 'tr' if null in DeleteTranslator.
2018-03-22 19:01:59 +00:00
Reece H. Dunn
07e155a150
TranslateWord2: Don't process invalid phonemes.
...
If ph_code is not located in the phoneme_tab, the resulting ph
value will be NULL. This does not normally happen, but it can
happen if word_phonemes contains garbage data, such as with the
1.49.2 multi-word logic when processing words like 'riposted'.
2018-03-11 18:00:38 +00:00
Reece H. Dunn
eaa08a2bc3
translate: Don't crash translating root words that map to another list entry.
...
If the list file contains a text replacement to another
entry in the list file, e.g.:
ripost riposte $text
riposte rI#p0st
calling it from a prefix or suffix rule such as 'riposted'
causes word_out[0] to be NULL, as TranslateWord3 has the
information needed to perform the mapping. In this case,
no phonemes have been written in this loop and the phonemes
have been calculated, so don't override them.
2018-03-11 17:58:15 +00:00
Juho Hiltunen
9012f3f0bf
headers: continue with synthdata.h
2018-03-10 13:54:58 +02:00
Juho Hiltunen
231a1d0944
headers: add new file dictionary.h with declarations of functions in dictionary.c
2018-03-10 12:47:02 +02:00
Juho Hiltunen
cd991bd2c9
headers: add new file numbers.h with declarations of functions in numbers.c
2018-03-10 09:27:23 +02:00
Juho Hiltunen
d395efa481
headers: add new file phonemelist.h with declarations of functions in phonemelist.c
2018-03-10 08:02:24 +02:00
Juho Hiltunen
706df97b20
headers: add new file readclause.h with declarations of functions in readclause.c
2018-03-10 07:18:07 +02:00
Reece H. Dunn
c5f88c51dd
translate.c: Don't loop to the end of sbuf, as sbuf gets null terminated, so needs a byte for the null character. [msvc /analyze].
2018-03-07 12:56:26 +00:00
Juho Hiltunen
78749f14f8
readability fix: use boolean instead of 0 and 1 for loop control
2018-02-17 18:17:00 +02:00
Juho Hiltunen
4f56345fb5
Use stdbool instead of int (Issue #8 )
...
See issue #8 , https://github.com/espeak-ng/espeak-ng/issues/8
There might still be some ints that could be changed to boolean.
Possible regressions in fifo.c:
int fifo_is_busy() and int fifo_is_command_enabled() used to return an int. Now they return a boolean. This might cause problems on systems where stdbool true/false is something else than 1/0.
2017-12-09 17:34:05 +02:00
Reece H. Dunn
7a33e60234
Reapply the emoji fix from commit 119c200e, only changing the code causing the issue.
2017-11-04 08:31:13 +00:00