11from ovos_plugin_manager .utils import load_plugin , find_plugins , PluginTypes
22from ovos_plugin_manager .templates .g2p import Grapheme2PhonemePlugin , PhonemeAlphabet
3+ from ovos_utils .log import LOG
4+ from ovos_utils .configuration import read_mycroft_config
35
46
57def find_g2p_plugins ():
@@ -13,7 +15,7 @@ def load_g2p_plugin(module_name):
1315class OVOSG2PFactory :
1416 """ replicates the base mycroft class, but uses only OPM enabled plugins"""
1517 MAPPINGS = {
16- "cmudict " : "ovos-g2p-plugin-cmudict " ,
18+ "dummy " : "ovos-g2p-plugin-dummy " ,
1719 "phoneme_guesser" : "neon-g2p-plugin-phoneme-guesser" ,
1820 "gruut" : "neon-g2p-plugin-gruut"
1921 }
@@ -30,9 +32,9 @@ def get_class(config=None):
3032 }
3133 """
3234 config = config or get_g2p_config ()
33- g2p_module = config .get ("module" ) or 'cmudict '
34- if g2p_module == 'cmudict ' :
35- return G2P
35+ g2p_module = config .get ("module" ) or 'dummy '
36+ if g2p_module == 'dummy ' :
37+ return Grapheme2PhonemePlugin
3638 if g2p_module in OVOSG2PFactory .MAPPINGS :
3739 g2p_module = OVOSG2PFactory .MAPPINGS [g2p_module ]
3840 return load_g2p_plugin (g2p_module )
@@ -49,12 +51,11 @@ def create(config=None):
4951 }
5052 """
5153 g2p_config = get_g2p_config (config )
52- g2p_module = g2p_config .get ('module' , 'cmudict ' )
54+ g2p_module = g2p_config .get ('module' , 'dummy ' )
5355 try :
5456 clazz = OVOSG2PFactory .get_class (g2p_config )
5557 LOG .info (f'Found plugin { g2p_module } ' )
56- g2p = clazz (g2p_lang , g2p_config )
57- g2p .validator .validate ()
58+ g2p = clazz (g2p_config )
5859 LOG .info (f'Loaded plugin { g2p_module } ' )
5960 except Exception :
6061 LOG .exception ('The selected G2P plugin could not be loaded.' )
@@ -66,7 +67,7 @@ def get_g2p_config(config=None):
6667 config = config or read_mycroft_config ()
6768 if "g2p" in config :
6869 config = config ["g2p" ]
69- g2p_module = config .get ('module' , 'cmudict ' )
70+ g2p_module = config .get ('module' , 'dummy ' )
7071 g2p_config = config .get (g2p_module , {})
7172 g2p_config ["module" ] = g2p_module
7273 return g2p_config
0 commit comments