POS.VERB and POS.NOUN

Help
zackling
2004-12-29
2013-04-29
  • zackling

    zackling - 2004-12-29

    What Difference Does it make if i put Dictionary.getInstance().getIndexWord(POS.NOUN, "dog");

    instead of

    Dictionary.getInstance().getIndexWord(POS.VERB, "dog");
    ??

    Is there a way to get POS.VERB or POS.NOUN for a particular word instead of hard coding it as I will be reading words from a text file. Thanks

     
    • leeo

      leeo - 2005-01-03

      there is another post that explains this on the forum cant remember its name but its there

       
    • Erh-Wen,Kuo

      Erh-Wen,Kuo - 2005-01-05

      Hi Zack
      In WordNet, there are possible four basic types of "Sense" according to the word you want to search. They are verb, noun, adjective and adverb. For example, the word "check" could related to two groups of senses including "Noun" & "Verb" (You could use WordNet origin client to find out!). And each groud contains several senses. In order to user JWNL to get the same result as WordNet client does, below are the steps I will use:
      Step1. Try to use below method to see if you could get a "IndexWord" object using Dictionary.getInstance().getIndexWord(POS.VERB, "check");
      Step2. If the "IndexWord" object from Step1 is not null, and "IndexWord".getSenseCount() > 0. Then you can sure there are sense belong to this "POS.VERB" group.
      Step3. Use "IndexWord".getSense to get the "Synset" array, then each by each using "Synset".getGloss() to output the content of the sense.
      Step4. Go back to step one and change to different POS type, for example POS.VERB, POS.ADJECTIVE or POS.ADVERB.

       
    • Erh-Wen,Kuo

      Erh-Wen,Kuo - 2005-01-05

      IndexWord idxWord = Dictionary.getInstance().getIndexWord(POS.VERB, "check");
      if(idxWord != null && idxWord.getSenseCount()>0){
      for(int i=0; i<idxWord.getSenseCount(); i++){
      System.out.println(idxWord.getSense(i).getGloss());
      }
      }

      IndexWord idxWord = Dictionary.getInstance().getIndexWord(POS.NOUN, "check");
      if(idxWord != null && idxWord.getSenseCount()>0){
      for(int i=0; i<idxWord.getSenseCount(); i++){
      System.out.println(idxWord.getSense(i).getGloss());
      }
      }

      IndexWord idxWord = Dictionary.getInstance().getIndexWord(POS.ADJECTIVE, "check");
      if(idxWord != null && idxWord.getSenseCount()>0){
      for(int i=0; i<idxWord.getSenseCount(); i++){
      System.out.println(idxWord.getSense(i).getGloss());
      }
      }

      IndexWord idxWord = Dictionary.getInstance().getIndexWord(POS.ADVERB, "check");
      if(idxWord != null && idxWord.getSenseCount()>0){
      for(int i=0; i<idxWord.getSenseCount(); i++){
      System.out.println(idxWord.getSense(i).getGloss());
      }
      }

       
    • zackling

      zackling - 2005-01-05

      I actually need this to do stemming for all the words in a document. So in order to get the base word, I need to do Dictionary.getInstance().getIndexWord(POS.VERB, "check");

      However for some words, I am unable to effectively stem it. Is there anyway to stem words from a document?

       
    • Erh-Wen,Kuo

      Erh-Wen,Kuo - 2005-01-06

      I am quite interesting about your question. Could you provide a example to describe what you want to do? It would be easier to picuture the problem.

       
    • zackling

      zackling - 2005-01-06

      My document is just like a normal passage with many words. I need to remove all suffixes by automation means using WordNet. Example:

              CONNECT
              CONNECTED
              CONNECTING
              CONNECTION
              CONNECTIONS

      All show return me CONNECT. However my concern is that some words like RESULTING will show that it is a adjective and after getLemma of the IndexWord, it returns RESULTING instead of RESULT.

      Is there any way of solving this problem?

       
    • zackling

      zackling - 2005-01-07

      I have managed to get the base word by using getMorphologicalProcessor().lookupBaseForm(POS, word)

      However some words may be both noun and verb so what i did was to do the lookupBaseForm for all POS and take the returned base word as the base word if there is a change in the word and base word.

       
    • Erh-Wen,Kuo

      Erh-Wen,Kuo - 2005-01-08

      That's a good information for me too.

       

Log in to post a comment.