Java Code Examples for edu.mit.jwi.item.POS#ADVERB

The following examples show how to use edu.mit.jwi.item.POS#ADVERB . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: POSTag.java    From senti-storm with Apache License 2.0 6 votes vote down vote up
public static POS convertArk(String arkTag) {
  if (arkTag.equals("N") || arkTag.equals("O") || arkTag.equals("^")
      || arkTag.equals("S") || arkTag.equals("Z")) {
    return POS.NOUN;
  }
  if (arkTag.equals("V")) {
    return POS.VERB;
  }
  if (arkTag.equals("A")) {
    return POS.ADJECTIVE;
  }
  if (arkTag.equals("R")) {
    return POS.ADVERB;
  }
  return null;
}
 
Example 2
Source File: Lemmatizer.java    From easyccg with MIT License 6 votes vote down vote up
private static POS getSynsetType(String pos) {
  if (!synsetTypeForPOS.containsKey(pos)) {
    POS result = null;
  
    if (pos.startsWith("NN")) {
      result = POS.NOUN;
    } else if (pos.startsWith("VB")) {
      result = POS.VERB;
    } else if (pos.startsWith("RB")) {
      result = POS.ADVERB;
    } else if (pos.startsWith("JJ")) {
      result = POS.ADJECTIVE;
    }
    
    if (result != null) {
      synsetTypeForPOS.put(pos, result);
    }
  }
  
  return synsetTypeForPOS.get(pos);
}
 
Example 3
Source File: GeneralUtils.java    From ADW with GNU General Public License v3.0 6 votes vote down vote up
/**
 * converts string to {@link POS}
 * @param tag
 * @return
 */
public static POS getTagfromTag(String tag)
{
	if(tag.toLowerCase().startsWith("n"))
		return POS.NOUN;
	
	else
		if(tag.toLowerCase().startsWith("v"))
			return POS.VERB;
	
	else
		if(tag.toLowerCase().startsWith("r") || tag.toLowerCase().startsWith("adv"))
			return POS.ADVERB;
		
	else
		if(tag.toLowerCase().startsWith("j") 
				|| tag.toLowerCase().startsWith("adj") 
				|| tag.toLowerCase().startsWith("a"))
			return POS.ADJECTIVE;
		
	return null;
}
 
Example 4
Source File: GeneralUtils.java    From ADW with GNU General Public License v3.0 6 votes vote down vote up
/**
 * transforms character into part of speech ({@link POS})
 * @param tag
 * @return
 */
public static POS getTagfromTag(char tag)
{
	switch(tag)
	{
		case 'n':
			return POS.NOUN;
		
		case 'v':
			return POS.VERB;
			
		case 'a':
			return POS.ADJECTIVE;
			
		case 'r':
			return POS.ADVERB;
			
		default:
			return null;
	}
}
 
Example 5
Source File: POSTag.java    From senti-storm with Apache License 2.0 5 votes vote down vote up
public static POS parseString(String tag) {
  switch (tag.charAt(0)) {
    case 'n':
      return POS.NOUN;
    case 'v':
      return POS.VERB;
    case 'a':
      return POS.ADJECTIVE;
    case 'r':
      return POS.ADVERB;
    default:
      throw new IllegalStateException("Unknown POS tag '" + tag + "'!");
  }
}
 
Example 6
Source File: POSTag.java    From senti-storm with Apache License 2.0 5 votes vote down vote up
public static POS convertPTB(String pennTag) {
  if (pennTag.startsWith("NN")) { // includes proper nouns
    return POS.NOUN;
  }
  if (pennTag.startsWith("VB")) {
    return POS.VERB;
  }
  if (pennTag.startsWith("JJ")) {
    return POS.ADJECTIVE;
  }
  if (pennTag.startsWith("RB")) {
    return POS.ADVERB;
  }
  return null;
}