for(Synset sens : entryMeanings){
//for (ThesaurusEntry word : sens.getWordSenses()){
Synset tempword = new Synset(wordcontext, sens.getURI(),null);
if(!temp.containsKey(tempword)){
QueryParameterEntry newqpe = new QueryParameterEntryImpl(sens.getLabel());
newqpe.setMeaning(tempword);
newqpe.setRanking((rank == 0 ) ? m2resource.wordnetBoost : m2resource.wordnetBoost * rank);
////logger.info("wynik33"+newqpe.getMeaning().getGlossaryDescription()+ " rank: " + newqpe.getRanking());
if (newqpe.getMeaning()!=qpe.getMeaning())
{
result.add(newqpe);
temp.put(tempword, sens.getLabel());
}
}else if (!temp.get(tempword).equals(sens.getLabel())){
QueryParameterEntry newqpe = new QueryParameterEntryImpl(sens.getLabel());
newqpe.setMeaning(tempword);
newqpe.setRanking((rank == 0 ) ? m2resource.wordnetBoost : m2resource.wordnetBoost * rank);
////logger.info("wynik33"+newqpe.getMeaning().getGlossaryDescription() + " rank: " + newqpe.getRanking());
if (newqpe.getMeaning()!=qpe.getMeaning())
{
result.add(newqpe);
temp.put(tempword, sens.getLabel());
}
}
// }
//extend each meaning with some *NYM
// targets.addAll(new ExpandSynset(sens).getTargets(pointer));
//Synset tempword2 = new Synset(wordcontext, sens.getURI());
//ttempsens.addAll(tempword2.getAntonyms());
//sens.getAntonyms();
try{
if(precise)
{
if((Configuration.PrecisionAntonyms))
{
ttempsens.addAll(sens.getAntonyms()); //No sense ?
}
if((Configuration.PrecisionHypernyms))
{
ttempsens.addAll(sens.getHypernyms());
}
if((Configuration.PrecisionHyponyms))
{
ttempsens.addAll(sens.getHyponyms());
}
if((Configuration.PrecisionSynonyms))
{
ttempsens.addAll(sens.getSynonyms());
}
}
else
{
if((Configuration.RecallAntonyms))
{
ttempsens.addAll(sens.getAntonyms()); //No sense ?
}
if((Configuration.RecallHypernyms))
{
ttempsens.addAll(sens.getHypernyms());
}
if((Configuration.RecallHyponyms))
{
ttempsens.addAll(sens.getHyponyms());
}
if((Configuration.RecallSynonyms))
{
ttempsens.addAll(sens.getSynonyms());
}
}
}catch (Exception e){
//logger.severe("Can not expand meanings with some *NYMs");
}
Collection<Synset> tempsens = new HashSet<Synset>();
for(ThesaurusEntry tt : ttempsens)
{
tempsens.add(new Synset (wordcontext, tt.getURI(), null));
}
targets.addAll(tempsens);
}
// }catch (JWNLException e){
// //logger.severe("Error getting expanded synset for meaning");
}catch (Exception e){
//logger.severe("Problems with getting expanded synset for meaning : "+e);
}
/*
* add *NYM synsets to the query
*/
WordNetContext wordcontext;
try {
wordcontext = WordNetContext.getContext();
for(Synset newSynset: targets){
// for(ThesaurusEntry word : newSynset.getWordSenses()){
Synset tempword = new Synset(wordcontext, newSynset.getURI(), null);
if(!temp.containsKey(tempword)){
QueryParameterEntry newqpe = new QueryParameterEntryImpl(newSynset.getLabel());
newqpe.setMeaning(tempword);
newqpe.setRanking((rank == 0 ) ? m2resource.wordnetBoost : m2resource.wordnetBoost * rank);
// //logger.info(newqpe.getMeaning().getGloss() + " rank: " + newqpe.getRanking());
if (newqpe.getMeaning()!=qpe.getMeaning())
{
String newInfo = qpe.TellMeAbout()+tempword.getLabel()+ " - " +tempword.getGlossaryDescription() +" has been retrieved as a expansion of "+qpe.getMeaning().getLabel()+" using Wordnet ";
newqpe.AddInfo(newInfo);
result.add(newqpe);
temp.put(tempword, newSynset.getLabel());
}
}else if (!temp.get(tempword).equals(newSynset.getLabel())){
QueryParameterEntry newqpe = new QueryParameterEntryImpl(newSynset.getLabel());
newqpe.setMeaning(tempword);
newqpe.setRanking((rank == 0 ) ? m2resource.wordnetBoost : m2resource.wordnetBoost * rank);
// //logger.info(newqpe.getMeaning().getGloss() + " rank: " + newqpe.getRanking());
if (newqpe.getMeaning()!=qpe.getMeaning())
{
String newInfo = qpe.TellMeAbout()+tempword.getLabel()+ " - " +tempword.getGlossaryDescription() +" has been retrieved as a expansion of "+qpe.getMeaning().getLabel()+" using Wordnet ";
newqpe.AddInfo(newInfo);
result.add(newqpe);
temp.put(tempword, newSynset.getLabel());
}
}
// }