Examples of VerbSynset


Examples of edu.smu.tspell.wordnet.VerbSynset

            
             }
            
             if(current.synset.getType() == SynsetType.VERB)
             {
               VerbSynset verbsyn = (VerbSynset) (current.synset);
               VerbSynset [] hypernyms = verbsyn.getHypernyms();
           VerbSynset [] troponyms = verbsyn.getTroponyms();
          
           // add all the neighbours in a single arraylist
           if(hypernyms != null)
             for(int i = 0 ; i < hypernyms.length ; i++)
               verb_neighbours.add(hypernyms[i]);
View Full Code Here

Examples of edu.smu.tspell.wordnet.VerbSynset

          NounSynset nounsyn = (NounSynset)(u.synset);
          hypernyms = nounsyn.getHypernyms();
        }
        else if(source.getType() == SynsetType.VERB)
        {
          VerbSynset nounsyn = (VerbSynset)(u.synset);
          hypernyms = nounsyn.getHypernyms();
         
        }
         
          /* for each parent of u */
          for(Synset v : hypernyms)
          {
              /* check if hashtable already contains a node for v */
             
              // if yes
              if(created.containsKey(v.hashCode()))
              {
                /* get the node */
                Node v_node =  created.get(v.hashCode());
               
                /* check if already marked */
                if(v_node.s_marked)
                  continue;
                else
                {
                  /* LCS is the node for v */
                  v_node.s_previous = u;
                  v_node.s_marked = true;
                  LCS = v_node;
                  return LCS;
                }
               
              }
             
              // if no
              if(!created.containsKey(v.hashCode()))
              {
                /* create a node for v */
                Node v_node = new Node();
                v_node.synset = v;
                v_node.s_previous = u;
                v_node.s_marked = true;
                /* add v_node to hashtable */
                created.put(v_node.synset.hashCode(), v_node);
                /* add node to toBeExpanded */
                s_toBeExpanded.add(v_node);
              }
                 
           
           }
        }
       
             
      /*
       * BFS from target
       */
      if(!t_toBeExpanded.isEmpty())
      {
     
        Synset [] hypernyms = null;
        /* remove the first element from the toBeExpanded queue */
        Node u = t_toBeExpanded.remove(0);
       
               
        /* check if source and target are NOUN or VERB */
        if(target.getType() == SynsetType.NOUN)
        {
          /* get all the immediate parents of u */
          NounSynset nounsyn = (NounSynset)(u.synset);
          hypernyms = nounsyn.getHypernyms();
        }
        else if(target.getType() == SynsetType.VERB)
        {
          VerbSynset nounsyn = (VerbSynset)(u.synset);
          hypernyms = nounsyn.getHypernyms();
         
        }
         
          /* for each parent of u */
          for(Synset v : hypernyms)
View Full Code Here

Examples of edu.smu.tspell.wordnet.VerbSynset

        NounSynset nounsyn = (NounSynset) (u.synset);
        hypernyms = nounsyn.getHypernyms();
      }
      else if(source.getType() == SynsetType.VERB)
      {
        VerbSynset nounsyn = (VerbSynset) (u.synset);
        hypernyms = nounsyn.getHypernyms();
      }
     
      /* if u has no parents then its a root */
      if(hypernyms.length == 0)
      {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.