I forked rhasspy/gruut to include Luxembourgish as additional language. I followed the gruut documentation to create the SQLite database, the g2p model and the espeak word lexicon.
My luxembourgish lexicon has no word roles. I tried both scripts lexicon2db.py
and corpus2db.py
to create the lexicon.db
files, with success. I checked the content of the database with the DB Browser for SQLite.
I modified the gruut/lang.py script by adding the following lines in positions 146 and 664 :
if lang_only == "lb-lb":
# LĂ«tzebuergesch
return get_lb_settings(lang_dir, **settings_args)
# -----------------------------------------------------------------------------
# Luxembourgish (lb, LĂ«tzebuergesch)
# -----------------------------------------------------------------------------
def get_lb_settings(lang_dir=None, **settings_args) -> TextProcessorSettings:
"""Create settings for Luxembourgish"""
settings_args = {
"major_breaks": {".", "?", "!"},
"minor_breaks": {",", ";", ":", "..."},
"word_breaks": {"-", "_"},
"begin_punctuations": {'"', "“", "«", "[", "(", "<", "„"},
"end_punctuations": {'"', "”", "»", "]", ")", ">"},
"default_currency": "EUR",
"default_date_format": InterpretAsFormat.DATE_DMY,
"replacements": [("’", "'")], # normalize apostrophe
**settings_args,
}
return TextProcessorSettings(lang="lb_LB", **settings_args)
Cloning and installing the modified repository in my Ubuntu 20.04 PC works as expected. But when running the command
gruut --language lb-lb "Hallo"
the following runtime error is issued :
sqlite3.OperationalError: no such column: role
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/mbarnig/GRUUT/bin/gruut", line 11, in <module>
load_entry_point('gruut==2.0.4', 'console_scripts', 'gruut')()
File "/home/mbarnig/GRUUT/lib/python3.8/site-packages/gruut/__main__.py", line 149, in main
raise TextProcessingError(text) from e
gruut.__main__.TextProcessingError: Hallo
What is wrong with my fork ?
Thank you for your help.
Marco Barnig