Juho Hiltunen
cffdfb837b
code cleanup: move function declarations from speech.h to new file mnemonics.h
...
This adds a corresponding header file for mnemonics.c that was introduced in d5d93be .
2021-02-22 16:56:19 +02: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
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
Valdis Vitolins
9f0667de86
Part of issue #199 — extend .replace rule to allow using groups of characters
2018-07-09 20:27:51 +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
1bad240de8
maintainability: remove some unused variables and unnecessary extern declarations
2018-03-24 15:03:48 +02:00
Reece H. Dunn
87a2586bb0
Fix formatting of free_rules.
2018-03-22 07:19:26 +00:00
Reece H. Dunn
a08d2c7bfb
Ensure the allocated rules are properly cleaned up in compile_dictrules.
2018-03-21 20:58:55 +00:00
Juho Hiltunen
e04ae259e0
headers: add new file compiledict.h with declarations of functions in compiledict.c
2018-03-10 12:51:24 +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
706df97b20
headers: add new file readclause.h with declarations of functions in readclause.c
2018-03-10 07:18:07 +02:00
Juho Hiltunen
738492100a
make all headers (almost) self-contained by using include guards and #include statements within headers
2018-03-09 21:08:15 +02:00
Juho Hiltunen
78749f14f8
readability fix: use boolean instead of 0 and 1 for loop control
2018-02-17 18:17:00 +02:00
Reece H. Dunn
54e87adbb8
Move isspace2 from compiledict.c to translate.c.
2017-10-24 07:29:58 +01:00
Reece H. Dunn
7f42e0aaca
compiledict.c: Fix -Wmissing-prototypes warnings.
2017-10-11 07:51:36 +01:00
Reece H. Dunn
b8b0119b62
dictionary.c: Fix -Wmissing-prototypes warnings.
2017-10-11 07:46:17 +01:00
Reece H. Dunn
74f9f5e34b
wavegen.c: Fix -Wmissing-prototypes warnings.
2017-10-10 21:37:46 +01:00
Reece H. Dunn
ebfa320956
Fix storing the line length in the hash chain.
...
The length is stored as the first byte in the output from
compile_line. As the data pointer is char, if char is signed then
length could be negative resulting in undefined behaviour. This
commit fixes the issue by reading and writing that byte as a
uint8_t.
This bug was caused by 2a00ca79f6 .
Previously, the entries could only be a maximum of 128 bytes, and
would not be negative on platforms with signed chars. That
commit was made to support long emoji entries, especially for
non-Latin languages where the utf-8 representations could be
longer than 128 bytes.
This change also adds some documentation to make it clearer what
is going on. NOTE: The code should really be using actual struct
objects instead of writing to opaque char buffers.
Reported by Reef Turner <reef@nvaccess.org >
2017-07-26 20:44:27 +01:00
Reece H. Dunn
e7ac4b819d
hash_counts is never used, so remove it.
...
Reported by Reef Turner <reef@nvaccess.org >
2017-07-26 20:21:05 +01:00
Reef Turner
0994206f71
address buffer overrun when dict listx file has no trailling newline
...
See ar_listx as an example.
2017-07-25 14:29:45 +08:00
Reece H. Dunn
2a00ca79f6
Increase dict_line to support long emoji entries.
2017-06-04 19:47:30 +01:00
Reece H. Dunn
d5d980862e
Guard against overflowing the dict_line bounds when compiling dictionary files.
2017-06-04 19:38:40 +01:00
Reece H. Dunn
8dde51ca87
Remove the now unused emoji_zwj specifier.
2017-05-25 07:23:21 +01:00
Reece H. Dunn
7e85b36b4d
en: (emoji) -- Unicode Emoji 4.0 (Emoji Roles)
2017-05-18 07:16:05 +01:00
Reece H. Dunn
dcc43bc30a
Support _emoji dictionary lists for symbol and emoji pronunciations.
2017-05-14 11:05:43 +01:00
Reece H. Dunn
05cab4f2dc
Extend compile_line to include pronunciation data after a space (e.g. multi-word pronunciation replacements).
2017-05-14 08:39:29 +01:00
Reece H. Dunn
94376c2d5f
Use an enum and named values for the steps in compile_line to make the logic easier to read.
2017-05-11 19:40:43 +01:00
Reece H. Dunn
9af96da469
Make the encoding.h API public.
2017-05-02 18:40:16 +01:00
Reece H. Dunn
7c16ac543c
Use the text decoder API in readclause.c.
2017-03-31 13:17:37 +01:00
Reece H. Dunn
d5d93be00e
Group the LookupMnem API implementations into mnemonics.c.
2017-03-27 21:08:07 +01:00
Reece H. Dunn
5975f07095
Replace the *2 wchar/wctype APIs with their standard versions. These will be fixed using compatibility headers.
2017-02-13 07:43:23 +00:00
Reece H. Dunn
71c010b712
Remove unused wchar.h and wctype.h includes.
2017-02-10 08:03:40 +00:00
Valdis Vitolins
92eae4f322
Updates for issue #103 Maximum group number which works is actually 62
2016-09-05 22:05:55 +03:00
Ondřej Lysoněk
3817ee1e16
Moved speak_lib.h to espeak-ng directory
...
Moved include/espeak/speak_lib.h to include/espeak-ng/speak_lib.h and
created a symlink from the original location.
2016-08-28 10:57:10 +01:00
Valdis Vitolins
252c894e59
Issue espeak-ng/espeak-ng#120
...
Allow to decrease the score in the rule by adding
2016-08-07 16:13:16 +03:00
Reece H. Dunn
5673065168
Fix a null pointer dereference in compile_rule(compiledict.c). [Coverity]
2016-01-22 20:22:24 +00:00
Reece H. Dunn
96c43f3eb2
Clean up the include files to make them consistent.
2016-01-16 17:54:39 +00:00
Reece H. Dunn
9c7179189b
Add a stdint.h compatibility shim.
2016-01-09 13:09:50 +00:00
Reece H. Dunn
aeb1639b2e
Fix the error logic in espeak_ng_CompileDictionary(compiledict.c) [clang scan-build]
2016-01-06 22:41:57 +00:00
Reece H. Dunn
c521c7f9c2
Remove a dead assignment in compile_line(compiledict.c) [clang scan-build]
2016-01-06 22:19:51 +00:00
Reece H. Dunn
2c07be17f9
Remove a dead assignment in compile_rule(compiledict.c) [clang scan-build]
2016-01-06 22:18:15 +00:00
Reece H. Dunn
365e41076f
Remove a dead assignment in compile_rule(compiledict.c) [clang scan-build]
2016-01-06 22:17:29 +00:00
Reece H. Dunn
72db232ec3
Move include/espeak{-ng => }/speak_lib.h.
2016-01-04 19:45:23 +00:00
Reece H. Dunn
3f80fd712e
Use the error context API in the compile_dictrules helper function.
2016-01-04 13:52:25 +00:00
Reece H. Dunn
a3f0795fb7
Use the error context API in espeak_ng_CompileDictionary.
2016-01-04 11:28:18 +00:00
Reece H. Dunn
563e4e3769
Use ENS_ for eSpeak NG error codes, and standardize on a numbering scheme.
2016-01-02 12:20:25 +00:00
Reece H. Dunn
f9ea83430e
Use errno codes in place of ENE_(READ|WRITE)_ERROR.
2016-01-02 11:58:12 +00:00
Reece H. Dunn
f38a075575
The next_pause parameter of TranslateWord is not used, so remove it.
2015-12-30 08:58:36 +00:00
Reece H. Dunn
230ddd9fe2
Generate build errors if phoneme or language data files contain errors.
2015-12-29 15:00:31 +00:00