Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

instance not hypernym

Help
2010-04-08
2013-04-29
  • Vanessa Lopez
    Vanessa Lopez
    2010-04-08

    Hi, I use this function to get the hypernyms of a word:
    PointerUtils.getInstance().getDirectHypernyms(this.termIndex.getSense(sense));

    But how can I differentiate words that are instances and therefore between hypernyms and types?

    e.g. "city" is given as an hypernym of "Odessa", however, "Odessa" is an INSTANCE of "city", not an hypernym. Is there any way to know when a word is an instance as it is shown in the WordNet online interface?

    Thanks a lot

     
  • Vanessa Lopez
    Vanessa Lopez
    2010-04-08

    Or in other words, how can you distinguish between instances-classes or individual-concepts?

     
  • Maccanzy
    Maccanzy
    2010-10-20

    Hi, to solve that I simply check if there are any Pointer where PointerType is "INSTANCE_HYPERNYM":

    for(Synset s :idw.getSenses()) {
    //ignore instances!!!
    if(s.getPointers(PointerType.INSTANCE_HYPERNYM).length != 0) { // this is an intance!
    continue;
    }else{
    //your code here
    }

    }