Am I doing everything right?

Help
Anonymous
2003-02-27
2003-02-27

  • Anonymous
    2003-02-27

    When you search for a string "animal",

    WORDNET WEBSITE OUTPUT IS:

    The noun "animal" has 1 sense in WordNet.

    1. animal, animate being, beast, brute, creature, fauna -- (a living organism characterized by voluntary movement)

    The adjective "animal" has 2 senses in WordNet.

    1. animal(prenominal), carnal, fleshly, sensual -- (of the appetites and passions of the body; "animal instincts"; "carnal knowledge"; "fleshly desire"; "a sensual delight in eating"; "music is the only sensual pleasure without vice")
    2. animal (vs. vegetable) (vs. mineral) -- (of the nature of or characteristic of or derived from an animal or animals; "the animal kingdom"; "animal instincts"; "animal fats")

    -------------------------------------------------------------------------------------------
    I WANT THE OUTPUT AS:

    Noun
    1.
    animal
    animate being
    beast
    brute
    creature
    fauna
    a living organism characterized by voluntary movement

    adjective
    1.
    animal
    carnal
    fleshly
    sensual
    of the appetites and passions of the body; "animal instincts"; "carnal knowledge"; "fleshly desire"; "a sensual delight in eating"; "music is the only sensual pleasure without vice

    2.
    animal
    of the nature of or characteristic of or derived from an animal or animals; "the animal kingdom"; "animal instincts"; "animal fats"

    --------------------------------------------------------------------------------------------------
    I have the following java code as told by experts in this forum. I need some more help.

             public static void SearchWord(String SearchStr) throws JWNLException {
                    
                            IndexWordSet iWordSet = dict.lookupAllIndexWords(SearchStr);
                            IndexWord[] iWordArray = iWordSet.getIndexWordArray();
                            for(int n=0; n<iWordArray.length; n++)
                            {
                                    Synset[] senses = iWordArray[n].getSenses();
                                    System.out.print("The " + iWordArray[n].getPOS().getLabel() + " " + iWordArray[n].getLemma() + " has " +
    senses.length + " sense" + (senses.length == 1 ? "" : "s") + " \n");
                   
                                    for (int i=0; i<senses.length; i++) {
                   
                                            Synset sense = senses[i];
                                            System.out.println("" + (i + 1) + ". \n" + getAllWords(sense) +"\n" +sense.getGloss());
                                            System.out.print("\n");
                                    }
                                    System.out.print("----------------------------\n");
                            }
             }      
                           
            public static String getAllWords(Synset sense){
            String allwords = new String();
            Word[] words = sense.getWords();
            for(int i=0;i<words.length;i++){
            allwords=allwords+"\n"+words[i].getLemma();
            }
            return allwords;
            }

    AM I doing everything right? am I using all the functions properly? am I not using some functions? PLEASE guide me
    My aim is to get every word seperately so that it can also be searched and get description (getGloss) seperatly?
    Also how to get rid of underscore "animate_being"

    Jin