synesketch.emotion.util
Class HeuristicsUtility

java.lang.Object
  extended by synesketch.emotion.util.HeuristicsUtility

public class HeuristicsUtility
extends java.lang.Object

Utility class for some heuristic alghoritms used for text processing.

Version:
1.0
Author:
Uros Krcadinac email: uros@krcadinac.com

Constructor Summary
HeuristicsUtility()
           
 
Method Summary
static double computeCapsLockQoef(java.lang.String word)
          Computes the upper case qoeficient.
static double computeEmoticonCoef(java.lang.String word, AffectWord emoticon)
          Computes emoticon qoef for the word.
static double computeEmoticonCoefForSentence(java.lang.String sentence)
          Computes emotiocon qoef for the sentence.
static double computeExclaminationQoef(java.lang.String text)
          Computes the exclamination qoef -- function of a number of '!'
static double computeModifier(java.lang.String word)
          Computes the intensity modifier based on the word.
static boolean hasNegation(java.lang.String sentence)
          Returns true if sentence has negation in it.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeuristicsUtility

public HeuristicsUtility()
Method Detail

computeEmoticonCoefForSentence

public static double computeEmoticonCoefForSentence(java.lang.String sentence)
                                             throws java.io.IOException
Computes emotiocon qoef for the sentence. Qoef is based on number of important chars in an emotion (e.g. ')' in ':)))))' ).

Parameters:
sentence - String representing the sentence
Returns:
double value of the emoticon coef
Throws:
java.io.IOException

computeEmoticonCoef

public static double computeEmoticonCoef(java.lang.String word,
                                         AffectWord emoticon)
Computes emoticon qoef for the word. Qoef is based on number of important chars in an emotion (e.g. ')' in ':)))))' ).

Parameters:
word - String representing the word
emoticon - AffectWord representing the emoticon
Returns:
double value of the emoticon qoef

hasNegation

public static boolean hasNegation(java.lang.String sentence)
                           throws java.io.IOException
Returns true if sentence has negation in it.

Parameters:
sentence - String representing the sentence
Returns:
boolean, true if sentence has negation in it
Throws:
java.io.IOException

computeModifier

public static double computeModifier(java.lang.String word)
                              throws java.io.IOException
Computes the intensity modifier based on the word.

Parameters:
word - String representing the word
Returns:
double representing the modifier
Throws:
java.io.IOException

computeCapsLockQoef

public static double computeCapsLockQoef(java.lang.String word)
Computes the upper case qoeficient.

Parameters:
word - String representing the word
Returns:
double representing the upper case qoeficient

computeExclaminationQoef

public static double computeExclaminationQoef(java.lang.String text)
Computes the exclamination qoef -- function of a number of '!' chars in a sentence.

Parameters:
text - String representing the sentence
Returns:
double representing the exclamination qoef