/** * Indicate that the registration is now complete. No further calls to registerModules() will be possible. * * @throws IllegalStateException * if called when registration was already completed before. */ public static void setRegistrationComplete() throws IllegalStateException { if (registrationComplete) throw new IllegalStateException("Registration has already completed, cannot do that a second time"); // Set registration complete lockup registrationComplete = true; MaryDataType.setRegistrationComplete(); // Define system preferred modules List<String> preferredModulesClasses = MaryProperties.getList("modules.preferred.classes.list"); if ((preferredModulesClasses == null) || (preferredModulesClasses.isEmpty())) return; preferredModules = new ArrayList<MaryModule>(); for (String moduleInfo : preferredModulesClasses) { try { MaryModule mm = null; if (!moduleInfo.contains("(")) { // no constructor info mm = ModuleRegistry.getModule(Class.forName(moduleInfo)); } preferredModules.add(mm); } catch (ClassNotFoundException e) { logger.warn("Cannot initialise preferred module " + moduleInfo + " -- skipping.", e); } } }
/** * Indicate that the registration is now complete. No further calls to registerModules() will be possible. * * @throws IllegalStateException * if called when registration was already completed before. */ public static void setRegistrationComplete() throws IllegalStateException { if (registrationComplete) throw new IllegalStateException("Registration has already completed, cannot do that a second time"); // Set registration complete lockup registrationComplete = true; MaryDataType.setRegistrationComplete(); // Define system preferred modules List<String> preferredModulesClasses = MaryProperties.getList("modules.preferred.classes.list"); if ((preferredModulesClasses == null) || (preferredModulesClasses.isEmpty())) return; preferredModules = new ArrayList<MaryModule>(); for (String moduleInfo : preferredModulesClasses) { try { MaryModule mm = null; if (!moduleInfo.contains("(")) { // no constructor info mm = ModuleRegistry.getModule(Class.forName(moduleInfo)); } preferredModules.add(mm); } catch (ClassNotFoundException e) { logger.warn("Cannot initialise preferred module " + moduleInfo + " -- skipping.", e); } } }
MaryModule mm = null; if (!moduleInfo.contains("(")) { // no constructor info mm = ModuleRegistry.getModule(Class.forName(moduleInfo));
MaryModule mm = null; if (!moduleInfo.contains("(")) { // no constructor info mm = ModuleRegistry.getModule(Class.forName(moduleInfo));
public void startup() throws Exception { super.startup(); try { targetFeatureLister = (TargetFeatureLister) ModuleRegistry.getModule(TargetFeatureLister.class); } catch (NullPointerException npe) { targetFeatureLister = null; } if (targetFeatureLister == null) { logger.info("Starting my own TargetFeatureLister"); targetFeatureLister = new TargetFeatureLister(); targetFeatureLister.startup(); } else if (targetFeatureLister.getState() == MaryModule.MODULE_OFFLINE) { targetFeatureLister.startup(); } }
public void startup() throws Exception { super.startup(); try { targetFeatureLister = (TargetFeatureLister) ModuleRegistry.getModule(TargetFeatureLister.class); } catch (NullPointerException npe) { targetFeatureLister = null; } if (targetFeatureLister == null) { logger.info("Starting my own TargetFeatureLister"); targetFeatureLister = new TargetFeatureLister(); targetFeatureLister.startup(); } else if (targetFeatureLister.getState() == MaryModule.MODULE_OFFLINE) { targetFeatureLister.startup(); } }
public void startup() throws Exception { super.startup(); // We depend on the Synthesis module: MaryModule synthesis; try { synthesis = ModuleRegistry.getModule(marytts.modules.Synthesis.class); } catch (NullPointerException npe) { synthesis = new Synthesis(); } assert synthesis != null; if (synthesis.getState() == MaryModule.MODULE_OFFLINE) synthesis.startup(); // load klatt rules klattRuleParams = new Properties(); klattRuleParams.load(new FileInputStream(MaryProperties.needFilename(localePrefix + ".cap.klattrulefile"))); // load phone list allophoneSet = MaryRuntimeUtils.needAllophoneSet(localePrefix + ".allophoneset"); klattDurationParams = new KlattDurationModeller.KlattDurationParams(MaryProperties.needFilename(localePrefix + ".cap.klattdurfile")); // instantiate the Map in which settings are associated with elements: // (when the objects serving as keys are not in ordinary use any more, // the key-value pairs are deleted from the WeakHashMap earlier or // later; that means we do not need to keep track of the hashmaps per // thread) prosodyMap = new WeakHashMap(); }
public void startup() throws Exception { super.startup(); // We depend on the Synthesis module: MaryModule synthesis; try { synthesis = ModuleRegistry.getModule(marytts.modules.Synthesis.class); } catch (NullPointerException npe) { synthesis = new Synthesis(); } assert synthesis != null; if (synthesis.getState() == MaryModule.MODULE_OFFLINE) synthesis.startup(); // load klatt rules klattRuleParams = new Properties(); klattRuleParams.load(new FileInputStream(MaryProperties.needFilename(localePrefix + ".cap.klattrulefile"))); // load phone list allophoneSet = MaryRuntimeUtils.needAllophoneSet(localePrefix + ".allophoneset"); klattDurationParams = new KlattDurationModeller.KlattDurationParams(MaryProperties.needFilename(localePrefix + ".cap.klattdurfile")); // instantiate the Map in which settings are associated with elements: // (when the objects serving as keys are not in ordinary use any more, // the key-value pairs are deleted from the WeakHashMap earlier or // later; that means we do not need to keep track of the hashmaps per // thread) prosodyMap = new WeakHashMap(); }
/** * Indicate that the registration is now complete. No further calls to registerModules() will be possible. * * @throws IllegalStateException * if called when registration was already completed before. */ public static void setRegistrationComplete() throws IllegalStateException { if (registrationComplete) throw new IllegalStateException("Registration has already completed, cannot do that a second time"); // Set registration complete lockup registrationComplete = true; MaryDataType.setRegistrationComplete(); // Define system preferred modules List<String> preferredModulesClasses = MaryProperties.getList("modules.preferred.classes.list"); if ((preferredModulesClasses == null) || (preferredModulesClasses.isEmpty())) return; preferredModules = new ArrayList<MaryModule>(); for (String moduleInfo : preferredModulesClasses) { try { MaryModule mm = null; if (!moduleInfo.contains("(")) { // no constructor info mm = ModuleRegistry.getModule(Class.forName(moduleInfo)); } preferredModules.add(mm); } catch (ClassNotFoundException e) { logger.warn("Cannot initialise preferred module " + moduleInfo + " -- skipping.", e); } } }
MaryModule mm = null; if (!moduleInfo.contains("(")) { // no constructor info mm = ModuleRegistry.getModule(Class.forName(moduleInfo));
public void startup() throws Exception { super.startup(); try { targetFeatureLister = (TargetFeatureLister) ModuleRegistry.getModule(TargetFeatureLister.class); } catch (NullPointerException npe) { targetFeatureLister = null; } if (targetFeatureLister == null) { logger.info("Starting my own TargetFeatureLister"); targetFeatureLister = new TargetFeatureLister(); targetFeatureLister.startup(); } else if (targetFeatureLister.getState() == MaryModule.MODULE_OFFLINE) { targetFeatureLister.startup(); } }
public void startup() throws Exception { super.startup(); // We depend on the Synthesis module: MaryModule synthesis; try { synthesis = ModuleRegistry.getModule(marytts.modules.Synthesis.class); } catch (NullPointerException npe) { synthesis = new Synthesis(); } assert synthesis != null; if (synthesis.getState() == MaryModule.MODULE_OFFLINE) synthesis.startup(); // load klatt rules klattRuleParams = new Properties(); klattRuleParams.load(new FileInputStream(MaryProperties.needFilename(localePrefix + ".cap.klattrulefile"))); // load phone list allophoneSet = MaryRuntimeUtils.needAllophoneSet(localePrefix + ".allophoneset"); klattDurationParams = new KlattDurationModeller.KlattDurationParams(MaryProperties.needFilename(localePrefix + ".cap.klattdurfile")); // instantiate the Map in which settings are associated with elements: // (when the objects serving as keys are not in ordinary use any more, // the key-value pairs are deleted from the WeakHashMap earlier or // later; that means we do not need to keep track of the hashmaps per // thread) prosodyMap = new WeakHashMap(); }