mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-24 04:23:44 +00:00
autotools: support optionally building the extended Russian and Chinese dictionaries
This commit is contained in:
@@ -62,6 +62,9 @@ Makefile
|
|||||||
dictsource/*_extra
|
dictsource/*_extra
|
||||||
dictsource/dict_log
|
dictsource/dict_log
|
||||||
dictsource/dict_phonemes
|
dictsource/dict_phonemes
|
||||||
|
dictsource/ru_listx
|
||||||
|
dictsource/zh_listx
|
||||||
|
dictsource/zhy_list
|
||||||
|
|
||||||
phsource/compile_prog_log
|
phsource/compile_prog_log
|
||||||
phsource/compile_report
|
phsource/compile_report
|
||||||
|
|||||||
+18
@@ -659,7 +659,13 @@ espeak-data/ro_dict: src/espeak phsource/phonemes.stamp dictsource/ro_list dicts
|
|||||||
ru: espeak-data/ru_dict
|
ru: espeak-data/ru_dict
|
||||||
dictsource/ru_extra:
|
dictsource/ru_extra:
|
||||||
touch dictsource/ru_extra
|
touch dictsource/ru_extra
|
||||||
|
dictsource/ru_listx:
|
||||||
|
ln -svf extra/ru_listx dictsource/
|
||||||
|
if HAVE_RU_EXTENDED_DICTIONARY
|
||||||
|
espeak-data/ru_dict: src/espeak phsource/phonemes.stamp dictsource/ru_list dictsource/ru_rules dictsource/ru_extra dictsource/ru_listx
|
||||||
|
else
|
||||||
espeak-data/ru_dict: src/espeak phsource/phonemes.stamp dictsource/ru_list dictsource/ru_rules dictsource/ru_extra
|
espeak-data/ru_dict: src/espeak phsource/phonemes.stamp dictsource/ru_list dictsource/ru_rules dictsource/ru_extra
|
||||||
|
endif
|
||||||
cd dictsource && ESPEAK_DATA_PATH=$(PWD) LD_LIBRARY_PATH=../src:${LD_LIBRARY_PATH} ../src/espeak --compile=ru && cd ..
|
cd dictsource && ESPEAK_DATA_PATH=$(PWD) LD_LIBRARY_PATH=../src:${LD_LIBRARY_PATH} ../src/espeak --compile=ru && cd ..
|
||||||
|
|
||||||
si: espeak-data/si_dict
|
si: espeak-data/si_dict
|
||||||
@@ -731,11 +737,23 @@ espeak-data/vi_dict: src/espeak phsource/phonemes.stamp dictsource/vi_list dicts
|
|||||||
zh: espeak-data/zh_dict
|
zh: espeak-data/zh_dict
|
||||||
dictsource/zh_extra:
|
dictsource/zh_extra:
|
||||||
touch dictsource/zh_extra
|
touch dictsource/zh_extra
|
||||||
|
dictsource/zh_listx:
|
||||||
|
ln -svf extra/zh_listx dictsource/
|
||||||
|
if HAVE_ZH_EXTENDED_DICTIONARY
|
||||||
|
espeak-data/zh_dict: src/espeak phsource/phonemes.stamp dictsource/zh_list dictsource/zh_rules dictsource/zh_extra dictsource/zh_listx
|
||||||
|
else
|
||||||
espeak-data/zh_dict: src/espeak phsource/phonemes.stamp dictsource/zh_list dictsource/zh_rules dictsource/zh_extra
|
espeak-data/zh_dict: src/espeak phsource/phonemes.stamp dictsource/zh_list dictsource/zh_rules dictsource/zh_extra
|
||||||
|
endif
|
||||||
cd dictsource && ESPEAK_DATA_PATH=$(PWD) LD_LIBRARY_PATH=../src:${LD_LIBRARY_PATH} ../src/espeak --compile=zh && cd ..
|
cd dictsource && ESPEAK_DATA_PATH=$(PWD) LD_LIBRARY_PATH=../src:${LD_LIBRARY_PATH} ../src/espeak --compile=zh && cd ..
|
||||||
|
|
||||||
zhy: espeak-data/zhy_dict
|
zhy: espeak-data/zhy_dict
|
||||||
dictsource/zhy_extra:
|
dictsource/zhy_extra:
|
||||||
touch dictsource/zhy_extra
|
touch dictsource/zhy_extra
|
||||||
|
dictsource/zhy_list:
|
||||||
|
ln -svf extra/zhy_list dictsource/
|
||||||
|
if HAVE_ZHY_EXTENDED_DICTIONARY
|
||||||
|
espeak-data/zhy_dict: src/espeak phsource/phonemes.stamp dictsource/zhy_rules dictsource/zhy_extra dictsource/zhy_list
|
||||||
|
else
|
||||||
espeak-data/zhy_dict: src/espeak phsource/phonemes.stamp dictsource/zhy_rules dictsource/zhy_extra
|
espeak-data/zhy_dict: src/espeak phsource/phonemes.stamp dictsource/zhy_rules dictsource/zhy_extra
|
||||||
|
endif
|
||||||
cd dictsource && ESPEAK_DATA_PATH=$(PWD) LD_LIBRARY_PATH=../src:${LD_LIBRARY_PATH} ../src/espeak --compile=zhy && cd ..
|
cd dictsource && ESPEAK_DATA_PATH=$(PWD) LD_LIBRARY_PATH=../src:${LD_LIBRARY_PATH} ../src/espeak --compile=zhy && cd ..
|
||||||
|
|||||||
@@ -33,14 +33,17 @@ This is a mirror of the eSpeak sources with the following improvements on the
|
|||||||
1. An autotools-based build system that supports building the phoneme data and
|
1. An autotools-based build system that supports building the phoneme data and
|
||||||
language dictionaries from source on POSIX systems.
|
language dictionaries from source on POSIX systems.
|
||||||
|
|
||||||
2. Detection of the supported audio APIs via the `configure` script — no need to
|
2. Optional support for the extended Russian and Chinese dictionaries from
|
||||||
|
[http://espeak.sourceforge.net/data/](http://espeak.sourceforge.net/data/).
|
||||||
|
|
||||||
|
3. Detection of the supported audio APIs via the `configure` script — no need to
|
||||||
modify the build files.
|
modify the build files.
|
||||||
|
|
||||||
3. The NVDA voice variants are included in the `espeak-data/voices/!v` directory.
|
4. The NVDA voice variants are included in the `espeak-data/voices/!v` directory.
|
||||||
|
|
||||||
4. Add support for the Oromo language (`om`, contributed by [gude432](https://github.com/gude432)).
|
5. Add support for the Oromo language (`om`, contributed by [gude432](https://github.com/gude432)).
|
||||||
|
|
||||||
5. Support for wxWidgets 3.0.
|
6. Support for wxWidgets 3.0.
|
||||||
|
|
||||||
## Build Dependencies
|
## Build Dependencies
|
||||||
|
|
||||||
@@ -239,6 +242,10 @@ fixes detailed in the sections below. In addition, it:
|
|||||||
|
|
||||||
2. supports the Oromo language (`om`, contributed by [gude432](https://github.com/gude432)).
|
2. supports the Oromo language (`om`, contributed by [gude432](https://github.com/gude432)).
|
||||||
|
|
||||||
|
3. Optional support for the extended Russian (`ru`), Mandarin Chinese (`zh`)
|
||||||
|
and Cantonese Chinese (`zhy`) dictionaries from
|
||||||
|
[http://espeak.sourceforge.net/data/](http://espeak.sourceforge.net/data/).
|
||||||
|
|
||||||
#### Build System
|
#### Build System
|
||||||
|
|
||||||
The build system for eSpeak has been changed on the *master* branch to use
|
The build system for eSpeak has been changed on the *master* branch to use
|
||||||
|
|||||||
@@ -173,6 +173,44 @@ AM_CONDITIONAL(OPT_MBROLA, [test x"$have_mbrola" = xyes])
|
|||||||
AM_CONDITIONAL(OPT_SONIC, [test x"$have_sonic" = xyes])
|
AM_CONDITIONAL(OPT_SONIC, [test x"$have_sonic" = xyes])
|
||||||
AM_CONDITIONAL(OPT_ASYNC, [test x"$have_async" = xyes])
|
AM_CONDITIONAL(OPT_ASYNC, [test x"$have_async" = xyes])
|
||||||
|
|
||||||
|
dnl ================================================================
|
||||||
|
dnl Extended dictionary checks.
|
||||||
|
dnl ================================================================
|
||||||
|
|
||||||
|
AC_ARG_WITH([extdict-ru],
|
||||||
|
[AS_HELP_STRING([--with-extdict-ru], [use the extended Russian Dictionary file @<:@default=no@:>@])],
|
||||||
|
[])
|
||||||
|
|
||||||
|
if test "$with_extdict_ru" = "yes" ; then
|
||||||
|
have_extdict_ru=yes
|
||||||
|
else
|
||||||
|
have_extdict_ru=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_ARG_WITH([extdict-zh],
|
||||||
|
[AS_HELP_STRING([--with-extdict-zh], [use the extended Mandarin Chinese Dictionary file @<:@default=no@:>@])],
|
||||||
|
[])
|
||||||
|
|
||||||
|
if test "$with_extdict_zh" = "yes" ; then
|
||||||
|
have_extdict_zh=yes
|
||||||
|
else
|
||||||
|
have_extdict_zh=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_ARG_WITH([extdict-zhy],
|
||||||
|
[AS_HELP_STRING([--with-extdict-zhy], [use the extended Cantonese Chinese Dictionary file @<:@default=no@:>@])],
|
||||||
|
[])
|
||||||
|
|
||||||
|
if test "$with_extdict_zhy" = "yes" ; then
|
||||||
|
have_extdict_zhy=yes
|
||||||
|
else
|
||||||
|
have_extdict_zhy=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
AM_CONDITIONAL(HAVE_RU_EXTENDED_DICTIONARY, [test x"$have_extdict_ru" = xyes])
|
||||||
|
AM_CONDITIONAL(HAVE_ZH_EXTENDED_DICTIONARY, [test x"$have_extdict_zh" = xyes])
|
||||||
|
AM_CONDITIONAL(HAVE_ZHY_EXTENDED_DICTIONARY, [test x"$have_extdict_zhy" = xyes])
|
||||||
|
|
||||||
dnl ================================================================
|
dnl ================================================================
|
||||||
dnl wxWidgets checks.
|
dnl wxWidgets checks.
|
||||||
dnl ================================================================
|
dnl ================================================================
|
||||||
@@ -215,4 +253,9 @@ AC_MSG_NOTICE([
|
|||||||
MBROLA: ${have_mbrola}
|
MBROLA: ${have_mbrola}
|
||||||
Sonic: ${have_sonic}
|
Sonic: ${have_sonic}
|
||||||
Async: ${have_async}
|
Async: ${have_async}
|
||||||
|
|
||||||
|
Extended Dictionaries:
|
||||||
|
Russian: ${have_extdict_ru}
|
||||||
|
Chinese (Mandarin): ${have_extdict_zh}
|
||||||
|
Chinese (Cantonese): ${have_extdict_zhy}
|
||||||
])
|
])
|
||||||
|
|||||||
+17
-1
@@ -19,6 +19,13 @@ special_voices = {
|
|||||||
'zh-yue': 'zhy',
|
'zh-yue': 'zhy',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Support for extended dictionaries.
|
||||||
|
extended_dictionaries = {
|
||||||
|
'ru': 'ru_listx',
|
||||||
|
'zh': 'zh_listx',
|
||||||
|
'zhy': 'zhy_list',
|
||||||
|
}
|
||||||
|
|
||||||
exclude_voices = []
|
exclude_voices = []
|
||||||
|
|
||||||
def find_voices(path):
|
def find_voices(path):
|
||||||
@@ -43,7 +50,7 @@ find_voices('espeak-data/voices')
|
|||||||
find_phoneme_data('phsource')
|
find_phoneme_data('phsource')
|
||||||
|
|
||||||
for filename in os.listdir('dictsource'):
|
for filename in os.listdir('dictsource'):
|
||||||
if filename.endswith('_rules') or filename.endswith('_list') or filename.endswith('_listx'):
|
if filename.endswith('_rules') or filename.endswith('_list') or filename in ['bg_listx', 'it_listx']:
|
||||||
dic, cat = filename.split('_')
|
dic, cat = filename.split('_')
|
||||||
if dic in voices:
|
if dic in voices:
|
||||||
if not dic in dictionaries.keys():
|
if not dic in dictionaries.keys():
|
||||||
@@ -81,7 +88,16 @@ def write_dictionary_make_rules(f):
|
|||||||
f.write('%s: espeak-data/%s_dict\n' % (name, name))
|
f.write('%s: espeak-data/%s_dict\n' % (name, name))
|
||||||
f.write('dictsource/%s_extra:\n' % name)
|
f.write('dictsource/%s_extra:\n' % name)
|
||||||
f.write('\ttouch dictsource/%s_extra\n' % name)
|
f.write('\ttouch dictsource/%s_extra\n' % name)
|
||||||
|
if name in extended_dictionaries.keys():
|
||||||
|
ext = extended_dictionaries[name]
|
||||||
|
f.write('dictsource/%s:\n' % ext)
|
||||||
|
f.write('\tln -svf extra/%s dictsource/\n' % ext)
|
||||||
|
f.write('if HAVE_%s_EXTENDED_DICTIONARY\n' % name.upper())
|
||||||
|
f.write('espeak-data/%s_dict: src/espeak phsource/phonemes.stamp %s dictsource/%s_extra dictsource/%s\n' % (name, ' '.join(sorted(files)), name, ext))
|
||||||
|
f.write('else\n')
|
||||||
f.write('espeak-data/%s_dict: src/espeak phsource/phonemes.stamp %s dictsource/%s_extra\n' % (name, ' '.join(sorted(files)), name))
|
f.write('espeak-data/%s_dict: src/espeak phsource/phonemes.stamp %s dictsource/%s_extra\n' % (name, ' '.join(sorted(files)), name))
|
||||||
|
if name in extended_dictionaries.keys():
|
||||||
|
f.write('endif\n')
|
||||||
f.write('\tcd dictsource && ESPEAK_DATA_PATH=$(PWD) LD_LIBRARY_PATH=../src:${LD_LIBRARY_PATH} ../src/espeak --compile=%s && cd ..\n' % name)
|
f.write('\tcd dictsource && ESPEAK_DATA_PATH=$(PWD) LD_LIBRARY_PATH=../src:${LD_LIBRARY_PATH} ../src/espeak --compile=%s && cd ..\n' % name)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user