private void printMap(ImmutableMap<String, Integer> map, StringBuffer sb) { for (String key : map.keySet()) { sb.append(key).append(": ").append(map.get(key)).append("\n"); } }
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); }
/** * Finds the nominal predicates in the parse tree. */ public void identify() { predicateHeads = new LinkedHashSet<S>(); for (S node : TreeIterator.iterableTree(tree.getTree())) { if (SimplerCanonicalPosTag.NOUN.equals(SimplerPosTagConvertor.simplerPos(InfoGetFields.getCanonicalPartOfSpeech(node.getInfo())))) { if (nomlexMap.keySet().contains(InfoGetFields.getLemma(node.getInfo()).trim().toLowerCase(Locale.ENGLISH))) { predicateHeads.add(node); } } } }
public Set<Integer> getAllIndexesOfFeatures() throws TeEngineMlException { if (!built) throw new TeEngineMlException("FeatureVectorStructureOrganizer.getNumberOfFeatures() failed. Reason: Not yet built!"); Set<Integer> ret = new LinkedHashSet<Integer>(); for (Feature feature : Feature.values()) { ret.add(feature.getFeatureIndex()); } @SuppressWarnings("unchecked") ImmutableMap<String,Integer>[] maps = (ImmutableMap<String,Integer>[]) new ImmutableMap[]{ getRuleBasesFeatures(),getPluginFeatures(),getDynamicGlobalFeatures()}; for (ImmutableMap<String,Integer> map : maps) { for (String key : map.keySet()) { ret.add(map.get(key)); } } return ret; }
public Map<Integer, String> createMapOfFeatureNames() throws TeEngineMlException { if (!built) throw new TeEngineMlException("Not yet built!"); Map<Integer, String> ret = new LinkedHashMap<Integer, String>(); for (Feature feature : Feature.values()) { addKeyValueToMap(ret,feature.getFeatureIndex(),feature.name()); } @SuppressWarnings("unchecked") ImmutableMap<String,Integer>[] maps = (ImmutableMap<String,Integer>[]) new ImmutableMap[]{ruleBasesFeatures,pluginFeatures,dynamicGlobalFeatures}; for (ImmutableMap<String,Integer> map : maps) { for (String str : map.keySet()) { addKeyValueToMap(ret,map.get(str),str); } } return ret; }
public ImmutableSet<String> getAllowedDatasetNames() throws TeEngineMlException { if (null==this.teSystemEnvironment.getFeatureVectorStructureOrganizer().getDynamicGlobalFeatures()) { return new ImmutableSetWrapper<String>(new DummySet<String>()); } else { return this.teSystemEnvironment.getFeatureVectorStructureOrganizer().getDynamicGlobalFeatures().keySet(); } }
for (NomlexArgument nomlexArgument : nominalization.getMapArgumentToType().keySet())