@Override public ImmutableMap<String, Integer> getDynamicGlobalFeatures() throws TeEngineMlException { synchronized(this){ if (null == dynamicGlobalFeatures){dynamicGlobalFeatures = new ImmutableMapWrapper<String, Integer>(dynamicGlobalFeatures_);}} return dynamicGlobalFeatures; }
@Override public ImmutableMap<String, Integer> getRuleBasesFeatures() throws TeEngineMlException { synchronized(this){ if (null==ruleBasesFeatures){ruleBasesFeatures = new ImmutableMapWrapper<String, Integer>(ruleBasesFeatures_);}} return ruleBasesFeatures; }
@Override public ImmutableMap<String, Integer> getPluginFeatures() throws TeEngineMlException { synchronized(this){ if (null==pluginFeatures){pluginFeatures = new ImmutableMapWrapper<String, Integer>(pluginFeatures_);}} return pluginFeatures; }
public synchronized void sealRegistry() throws PluginAdministrationException { this.sealed = true; sortedCustomFeatures = DsUtils.createSortedImmutableList(customFeatures); immutableRegisteredPlugins = new ImmutableMapWrapper<String, PluginFactory>(registeredPlugins); immutableRegisteredInstanceBasedPlugins = new ImmutableMapWrapper<String, InstanceBasedPluginFactory>(registeredInstanceBasedPlugins); }
@Override public ImmutableMap<Integer, Double> getWeights() throws ClassifierException { return new ImmutableMapWrapper<Integer, Double>(convertArrayToMap(this.weights)); }
private void createMapTypeToArgument() { Map<ArgumentType, Set<NomlexArgument>> map = new LinkedHashMap<ArgumentType, Set<NomlexArgument>>(); for (NomlexArgument argument : mapArgumentToType.keySet()) { ArgumentType type = mapArgumentToType.get(argument); if (null==map.get(type)) { map.put(type, new LinkedHashSet<NomlexArgument>()); } map.get(type).add(argument); } mapTypeToArgument = new ImmutableMapWrapper<ArgumentType, Set<NomlexArgument>>(map); }
@Override public ImmutableMap<Integer, Double> getWeights() throws ClassifierException { if (!trainedOrModelLoaded) throw new ClassifierException("Not trained"); if (null==weightsForGetWeightsMethod) { synchronized(this) { if (null==weightsForGetWeightsMethod) { LinkedHashMap<Integer, Double> weightsForGetWeightsMethodMutable = new LinkedHashMap<Integer, Double>(); for (Integer index : parameters.keySet()) { if (index!=0) { weightsForGetWeightsMethodMutable.put(index-1, parameters.get(index)); } } weightsForGetWeightsMethod = new ImmutableMapWrapper<Integer, Double>(weightsForGetWeightsMethodMutable); } } } return weightsForGetWeightsMethod; }
this.ruleBasesFeatures = new ImmutableMapWrapper<String, Integer>(mapRuleBasesFeatures); this.pluginFeatures = new ImmutableMapWrapper<String, Integer>(mapPluginFeatures); this.dynamicGlobalFeatures = new ImmutableMapWrapper<String, Integer>(mapDynamicGlobalFeatures);
public void build() throws NomlexException { boolean initSucceeded = false; try { initNomlex(); initSucceeded = true; } catch(Exception e) { throw new NomlexException("Nomlex initialization failed.",e); } if (initSucceeded) { internalNomlexMap = new LinkedHashMap<String, Nominalization>(); processAllNomlexBaseEntries(); nomlexMap = new ImmutableMapWrapper<String, Nominalization>(internalNomlexMap); } }
mapPlugins = new ImmutableMapWrapper<String, Plugin>(mapOfPlugins); instanceBasedPlugins = new ImmutableSetWrapper<InstanceBasedPlugin>(setOfInstanceBasedPlugins);
verbsList.addAll(verbs); Nominalization nominalization = new Nominalization(noun, new ImmutableListWrapper<String>(verbsList), itsOwnRole, new ImmutableMapWrapper<NomlexArgument, ArgumentType>(mapArgumentToType)); if (null==nominalization.getNominal()) throw new NomlexException("BUG"); if (internalNomlexMap.containsKey(nominalization.getNominal()))
plugin.initForInstance(textText, hypothesisText, originalTextTrees, hypothesisTree, new ImmutableMapWrapper<ExtendedNode, String>(originalMapTreesToSentences), coreferenceInformation);