Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure Language module works with base install #164

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions neon_core/language/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from neon_core.configuration import Configuration, get_private_keys
from ovos_plugin_manager.language import load_lang_detect_plugin, \
load_tx_plugin

import os

from neon_utils.configuration_utils import get_neon_lang_config
from ovos_plugin_manager.language import load_lang_detect_plugin, \
load_tx_plugin
from neon_utils.configuration_utils import get_neon_lang_config, LOG
from neon_core.configuration import Configuration, get_private_keys


def get_lang_config():
Expand Down Expand Up @@ -75,6 +76,9 @@ def create(module=None):
clazz = load_tx_plugin(module)
else:
clazz = TranslatorFactory.CLASSES.get(module)
if not clazz:
LOG.error(f"Configured translation module not found ({module})")
return None
config["keys"] = get_private_keys()
return clazz(config)

Expand All @@ -92,6 +96,8 @@ def create(module=None):
clazz = load_lang_detect_plugin(module)
else:
clazz = DetectorFactory.CLASSES.get(module)

if not clazz:
LOG.error(f"Configured detection module not found ({module})")
return None
config["keys"] = get_private_keys()
return clazz(config)
1 change: 1 addition & 0 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ovos-skills-manager>=0.0.2

# plugins
ovos-plugin-manager==0.0.1
neon-lang-plugin-libretranslate>=0.1.2

# text parser modules
RAKEkeywords>=0.2.0