Juho Hiltunen
822abfd1f3
Fixes for Ukrainian language ( #1480 )
2022-11-01 22:13:32 +02:00
Juho Hiltunen
b0661692b1
fix a warning about deprecated egrep by using grep -E.
2022-10-31 21:00:02 +02:00
Juho Hiltunen
bdd46838c0
fix compiler warnings for unused variables and functions.
...
See commits ae97fa16 and a178ea1b .
2022-10-31 20:45:59 +02:00
Juho Hiltunen
1de9f4b52c
Revert "cleanup: reduce code duplication with a new function"
...
This reverts commit 8021528f5e .
Failing on CI/CD.
2022-10-30 10:56:59 +02:00
Juho Hiltunen
ec57210cc5
Merge branch 'duplicates'
...
Code cleanups found with static analyzers.
2022-10-30 10:12:23 +02:00
Juho Hiltunen
8021528f5e
cleanup: reduce code duplication with a new function
...
StatusCreateTerminatedMsg.
This is not covered by current tests.
2022-10-30 10:12:11 +02:00
Juho Hiltunen
55f1f8e113
cleanup: reduce code duplication with AddToVoicesList()
...
Checking for return value & continue might be redundant.
2022-10-30 10:12:11 +02:00
Juho Hiltunen
d47d2d0a40
cleanup: remove duplicate StringToWord()
...
Found with pmd-cpd static analysis
2022-10-30 10:12:11 +02:00
Juho Hiltunen
03ebb2fd11
cleanup: reduce variable scopes dictionary.c
2022-10-30 10:12:06 +02:00
Juho Hiltunen
f23ff88755
cleanup: reduce variable scopes in synthdata.c
2022-10-30 10:11:53 +02:00
Juho Hiltunen
5d4791ccd1
cleanup: reduce variable scopes in synthesize.c
2022-10-30 10:11:44 +02:00
Juho Hiltunen
54265990b5
cleanup: reduce variable scopes in wavegen.c
2022-10-30 10:11:44 +02:00
Juho Hiltunen
fa575b54cb
cleanup: fix knownConditionTrueFalse code smells
2022-10-30 10:11:44 +02:00
Juho Hiltunen
7c7ab9e177
cleanup: fix duplicateCondition code smell
2022-10-30 10:11:44 +02:00
Juho Hiltunen
19f98ed699
Update es-419 ( #1436 )
...
This fixes the intonation in Latin American Spanish questions, removes
the phoneme replacement (T to s) because it is already included in
phonemes es_la. It also eliminates the line languaje es 6, because when
the voice is in the dialect of Spain and it automatically changes to the
dialect of Latin America, it does not return to the dialect of Spain.
2022-10-29 15:02:33 +03:00
Juho Hiltunen
385105b7cd
Merge branch 'staticanalysis'
...
Fixes for some code smells found with cppcheck static code analysis tool.
2022-10-26 17:57:05 +03:00
Juho Hiltunen
507a5f5410
cleanup: fix unreadVariable code smell for variant_name in SelectVoiceByName()
2022-10-26 17:55:00 +03:00
Juho Hiltunen
14f12376a3
cleanup: change int skip to bool
2022-10-26 17:55:00 +03:00
Juho Hiltunen
8ddcf6ed94
cleanup: reduce variable scopes in voices.c
2022-10-26 17:54:55 +03:00
Juho Hiltunen
9900d55ccf
cleanup: reduce variable scopes in setlengths.c
2022-10-25 20:02:54 +03:00
Juho Hiltunen
78a037924e
cleanup: fix code smell knownConditionTrueFalse for strlen() >= 0
...
Strlen never retuns a negative value. Also combined if statements to
reduce complexity. This code currently has no tests.
2022-10-25 19:51:02 +03:00
Juho Hiltunen
07da7edeea
cleanup: fix code smell knownConditionTrueFalse
...
Inner 'n_bytes >= 0' will always be true.
2022-10-25 19:51:02 +03:00
Juho Hiltunen
59177db8ef
cleanup: fix code smell knownConditionTrueFalse
...
Inner 'p->stresslevel>=4' will always be true. Thus checking for
count_stressed is redundant.
2022-10-25 19:51:02 +03:00
Juho Hiltunen
ef809dcd7e
SetSpeed() refactoring ( #1465 )
...
Unify common parts of two implementations. Split into smaller functions.
2022-10-25 19:32:32 +03:00
Juho Hiltunen
d1e98942e3
Update README.md ( #1442 )
...
Google is now a LLC not Inc.
2022-10-25 19:30:55 +03:00
Juho Hiltunen
b94a5b160b
Add arm CI ( #1463 )
...
This allows to cover
- another arch that x86, which is also very common
- an arch where char is unsigned
- a little-endian arch
This is running under qemu-user, so significantly slower and doesn't
support ptrace thus no address sanitizer etc. but at least the undefined
sanitizer works.
2022-10-25 19:29:20 +03:00
Juho Hiltunen
8170775113
code cleanup: refactor and remove duplication by unifying SetSpeed()
...
implemantations.
It is unclear why the two implementations differ.
2022-10-25 19:24:55 +03:00
Juho Hiltunen
0c82988b44
cleanup: refactor and remove duplication from SetSpeed() implementations.
2022-10-25 19:24:55 +03:00
Juho Hiltunen
84f58824af
cleanup: refactor and remove duplication from SetSpeed() implementations.
2022-10-25 19:24:55 +03:00
Juho Hiltunen
9e9fb16b56
cleanup: use parameters instead of globals with SetSpeedMods
2022-10-25 19:24:55 +03:00
Juho Hiltunen
a4c70d7921
cleanup: remove setting samplerate with Sonic.
...
we currently only support 22050 as samplerate so this code has no
effect. This should be readded to setSpeed() with and without Sonic if
multiple samplerates are supported in the future.
2022-10-25 18:24:27 +03:00
Juho Hiltunen
bc16f819dd
cleanup: refactor and remove duplication from SetSpeed() implementations.
...
There are two SetSpeed(), one for Sonic and one without. The differences
are very small.
In SetSpeedMods(), sample rate is adjusted for Sonic only:
speed.min_sample_len = (speed.min_sample_len * samplerate_native) / 22050;
Since samplerate_native is 22050 at the moment this line has no effect.
2022-10-24 21:49:12 +03:00
Juho Hiltunen
5db96bd845
Staticanalysis ( #1457 )
...
Fixes for code smells from cppcheck static code analysis tool.
Also includes some function refactoring.
2022-10-23 19:45:47 +03:00
Juho Hiltunen
9e3ade9004
cleanup: reduce variable scopes in ssml.c
...
Contributes to #9 .
2022-10-23 19:34:59 +03:00
Juho Hiltunen
185c93e702
cleanup: reduce variable scopes in readclause.c
...
Contributes to #9 .
2022-10-23 19:15:18 +03:00
Juho Hiltunen
9be76c0b30
cleanup: fix cppcheck unusedVariable code smells
2022-10-23 18:44:30 +03:00
Juho Hiltunen
0551a234eb
cleanup: reduce variable scopes in translateword.c
...
Contributes to #9 .
2022-10-23 18:34:15 +03:00
Juho Hiltunen
b4053da400
cleanup: fix cppcheck identicalInnerCondition code smells
2022-10-23 18:09:06 +03:00
Juho Hiltunen
77df00ad79
cleanup: fix cppcheck unreadVariable code smell in common.c
2022-10-23 17:32:41 +03:00
Juho Hiltunen
80a632ed26
cleanup: reduce variable scopes in common.c
...
Contributes to #9 .
2022-10-23 17:32:41 +03:00
Juho Hiltunen
39ea6e3a90
cleanup: reduce variable scopes in translate.c
...
Contributes to #9 .
Found with cppcheck static code analyzer variableScope parameter.
2022-10-23 17:28:20 +03:00
Juho Hiltunen
ef1b562714
cleanup: remove code duplication by using SetPlist2()
2022-10-23 12:14:59 +03:00
Juho Hiltunen
319ce7b09f
cleanup: refactor duplicate loops to CalcWordLength().
...
Note: This code has no tests. Tests would pass even without a call to
this function.
2022-10-23 12:14:59 +03:00
Juho Hiltunen
139eef57d2
cleanup: refactor checking for _^_ to function SwitchLanguage()
2022-10-23 12:14:59 +03:00
Juho Hiltunen
268f5899c8
fixup e2862bbc
...
Changing da_rules was accidentally included in the commit.
2022-10-22 17:31:29 +03:00
Juho Hiltunen
c92f7b7bfe
cleanup: refactor checking FLAG_COMBINE into a function ( #1454 )
2022-10-22 11:55:38 +03:00
Juho Hiltunen
e2862bbc51
cleanup: refactor checking FLAG_COMBINE into a function
2022-10-22 11:49:27 +03:00
Juho Hiltunen
43d7c29d52
Increase targetSdk to 30 and support signature scheme v2 ( #1413 )
...
[This removes the warning that this app may not be compatible because it
was developed for an older
android-version.](https://developer.android.com/about/versions/10/behavior-changes-all#low-target-sdk-warnings )
Also, this adds support for signature scheme v2 and v3 [which reduces
the attack surface along with other
benefits](https://source.android.com/docs/security/features/apksigning#v1 ).
Lastly this adds 64-bit support for the APK, so this app can be
installed on 64-bit-only hardware.
2022-10-11 06:37:17 +03:00
Juho Hiltunen
c05690be34
cleanup: move LoadConfig to langopts.c
...
LoadConfig() should be refactored to support both voice and language options set
in LoadVoice() and LoadLanguageOptions().
2022-10-10 21:36:25 +03:00
Juho Hiltunen
0f1f006afe
Merge branch 'spellingStress'
2022-10-10 21:25:29 +03:00
Juho Hiltunen
dc60881171
et: fi: move spellingStress from code to language configuration
2022-10-10 21:20:53 +03:00
Juho Hiltunen
53e40ead80
docs: add spellingStress
2022-10-10 21:20:53 +03:00
Juho Hiltunen
015bb42a70
new configurable language option: spellingStress
2022-10-10 21:20:20 +03:00
Juho Hiltunen
f342b5d319
cleanup: make spelling_stress bool and set default value
2022-10-10 21:04:25 +03:00
Juho Hiltunen
e03ab8a8c4
tests: add a test for langopts.spelling_stress
2022-10-10 21:04:25 +03:00
Juho Hiltunen
c701b09c25
cleanup: reorganize LOPT defines
2022-10-10 20:08:22 +03:00
Juho Hiltunen
4d70ceceb5
Remove LOPT_IT_DOUBLING and delete unused functionality.
...
Code checked for both langopt LOPT_IT_DOUBLING and attribe $double.
LOPT_IT_DOUBLING is redundant. $double already has a test in
dictionary.test
Code had a check for tr->langopts.param[LOPT_IT_DOUBLING] & 2 but that bit value is
not used in any language. That logic was removed.
2022-10-10 19:57:23 +03:00
Juho Hiltunen
3b2557cfdd
et: fi: move configuration from code to language file
2022-10-10 19:49:42 +03:00
Juho Hiltunen
644f02c26a
fixup case V_TUNES
...
previous changing of variable names caused an error in the program logic.
2022-10-10 19:45:01 +03:00
Juho Hiltunen
78c9b55c5f
fixup language options status and maintainer.
2022-10-10 19:34:21 +03:00
Juho Hiltunen
b4c223a256
fixup: move some language option keywords to the correct MNEM_TAB.
...
Caused when creating LoadLanguageOptions().
2022-10-09 22:03:18 +03:00
Juho Hiltunen
7115e46879
fi: uncomment number configuration.
...
Accidentally commented out in ac82698f .
2022-10-09 20:41:22 +03:00
Juho Hiltunen
74fc17bbf1
Create langopts.c for language option configuration ( #1419 )
...
Loading Voice and Language options is complicated. They are not
separated in the code.
This PR creates langopts.c for holding language option related
configuration. In the future:
1. all new language options should go to langopts.c
2. voice options should have a similar file
3. LoadVoice should know if it's loading a voice or a language.
2022-10-09 16:48:18 +03:00
Juho Hiltunen
a19e4b8df2
resize and initialize a two-dimensional array to pass sanitizer
2022-10-09 16:38:53 +03:00
Juho Hiltunen
eae4595dc9
cleanup: move shared enums and MNEM_TABs to header file
2022-10-09 16:38:53 +03:00
Juho Hiltunen
78c6873427
cleanup: call CheckTranslator at start of LoadLangugeOptions
2022-10-09 16:38:53 +03:00
Juho Hiltunen
3182dee147
code cleanup: move CheckTranslator() to langopts.c
2022-10-09 16:38:53 +03:00
Juho Hiltunen
159ab0ee76
cleanup: move langopts.params handling to LoadLanguageOptions()
...
These have no tests and should be refactore to be similar to other
langopts.
2022-10-09 16:38:53 +03:00
Juho Hiltunen
b820b68182
cleanup: move words to LoadLanguageOptions()
2022-10-09 16:38:53 +03:00
Juho Hiltunen
ac82698f99
cleanup: move numbers to LoadLanguageOptions()
...
Note: This feature has no tests.
2022-10-09 16:38:53 +03:00
Juho Hiltunen
bdf18eafb1
cleanup: moved dictmin to LoadLanguageOptions()
...
Note: This feature has no tests. It doesn't look very useful and I think
could be removed.
2022-10-09 16:38:53 +03:00
Juho Hiltunen
e1d936dc52
cleanup: moved dictrules to LoadLanguageOptions()
2022-10-09 16:38:53 +03:00
Juho Hiltunen
f28841162f
moved tunes to LoadLanguageOptions()
2022-10-09 16:38:53 +03:00
Juho Hiltunen
c92180f918
cleanup: move n_tunes and tunes to where they are used
2022-10-09 16:38:53 +03:00
Juho Hiltunen
ec897eff32
fixup, add langopts.h to version control
2022-10-09 16:38:53 +03:00
Juho Hiltunen
e38142acd1
cleanup: moved intonation to LoadLanguageOptions()
2022-10-09 16:38:53 +03:00
Juho Hiltunen
8e3399bb98
cleanup: move stressRule to LoadLanguageOptions()
2022-10-09 16:38:53 +03:00
Juho Hiltunen
9caada3b31
cleanup: move stressOpt to LoadLanguageOptions()
2022-10-09 16:38:53 +03:00
Juho Hiltunen
46bc25e173
cleanup: move stressAmp to LoadLanguageOptions()
2022-10-09 16:38:53 +03:00
Juho Hiltunen
2a462e4afe
cleanup: move stressAdd to LoadLanguageOptions()
2022-10-09 16:38:52 +03:00
Juho Hiltunen
db57230320
fixup error message for Bad Voice attribute.
...
We currently have two switch statements. Every key should go to only one
of them.
2022-10-09 16:38:52 +03:00
Juho Hiltunen
77282aca34
cleanup: move stressLength to LoadLanguageOptions()
2022-10-09 16:38:52 +03:00
Juho Hiltunen
4a2890250b
code cleanup: new file langopts.c for handling language options.
...
The switch case in LoadVoice() currently mixes voice and language
options. This change will start separating them into two functions.
CheckTranslator will be moved to langopts.c. In the future there should
be no need to use it in voices.c. There will be other temporary
solutions also.
2022-10-09 16:38:52 +03:00
Juho Hiltunen
e5ae5b8557
tr: fix bağışlamak and bağışlayın
...
This removes these words from dictionary and uses translation rules
instead. Result is to shorten the i.
See #1337 and #1388 .
2022-10-04 17:19:10 +03:00
Juho Hiltunen
b17ed2d682
Update Changelog
2022-09-29 07:18:23 +03:00
Juho Hiltunen
a434ca4cbb
fix #1370 Cmn voice not correctly translated
...
1. Rewrite cmn_rules. Vowel will be spoken as Mandarin only when it's
with a tone number. Otherwise, it will be regarded as English. This will
make English words translated more correctly.
2. Fix issue of word item in cmn_listx not taking effect.
3. Fix dictionary_skipwords bug. It should be injected when re-structing
method TranslateWord3.
2022-09-29 07:09:34 +03:00
Juho Hiltunen
f5442cfe4e
Merge branch 'master' into master
2022-09-29 06:22:28 +03:00
Juho Hiltunen
b52441f9ac
tr: do not prolong â and î.
...
See #1388 and #875 .
2022-09-27 20:35:42 +03:00
Juho Hiltunen
4f9044c99f
Updates italian source dictionaries ( #1395 )
...
Add some rules and exceptions for italian language.
2022-09-25 20:30:57 +03:00
Juho Hiltunen
e46ed1ab16
Merge branch 'master' into master
2022-09-24 21:47:27 +03:00
Juho Hiltunen
80976d7fbf
docs: add a section about tests when adding a new language
...
Closes #1194 .
2022-09-24 08:25:26 +03:00
jaacoppi
df8af89ddd
Merge pull request #1379
...
Code cleanup: relocate functions & remove unused #defines
2022-09-17 20:03:10 +03:00
jaacoppi
57115a8eaf
Merge pull request #1376 from bkmgit/patch-1
...
Fix vowels link
2022-09-17 19:29:42 +03:00
Juho Hiltunen
545f38a46b
code cleanup: remove unused #defines
...
Note: Strange that FLAG_ALT7 is used but ALT4-ALT6 are not. Same with
R6p.
2022-09-17 19:19:44 +03:00
Juho Hiltunen
4a9f0e21be
code cleanup: move Is*() helper functions to common.c
2022-09-17 18:57:20 +03:00
Juho Hiltunen
57c7285ff9
code cleanup: move ApplySpecialAttribute2()
2022-09-17 18:20:38 +03:00
Juho Hiltunen
741bea9510
code cleanup: make LookupFlags() static
2022-09-17 18:09:23 +03:00
Juho Hiltunen
597cb2f440
code cleanup: move Unpronouncable() and Unpronouncable2()
2022-09-17 18:05:01 +03:00
Juho Hiltunen
9d03b09537
code cleanup: move ChangeWordStress()
2022-09-17 18:05:01 +03:00
Juho Hiltunen
c5db9220bf
code cleanup: move Read4Bytes()
2022-09-17 17:41:43 +03:00