Map<Formula,FbFormulasInfo.UnaryFormulaInfo> res = new HashMap<Formula, FbFormulasInfo.UnaryFormulaInfo>();
//professions
for(String profession: professionPopularityMap.keySet()) {
Formula f = new JoinFormula(PROF, new ValueFormula<Value>(new NameValue(profession)));
UnaryFormulaInfo info = new UnaryFormulaInfo(f, professionPopularityMap.get(profession),
MapUtils.get(professionDescriptionsMap,profession,new LinkedList<String>()),
Collections.singleton(PERSON));
if(!info.isComplete()) {
continue;
}
res.put(f, info);
}
//types
for(String type: typePopularityMap.keySet()) {
Formula f = new JoinFormula(TYPE, new ValueFormula<Value>(new NameValue(type)));
UnaryFormulaInfo info = new UnaryFormulaInfo(f, typePopularityMap.get(type),
MapUtils.get(typeDescriptionsMap,type,new LinkedList<String>()),
Collections.singleton(type));
if(!info.isComplete()) {
continue;
}
res.put(f, info);
}
return res;