synesketch.emotion
Class AffectWord

java.lang.Object
  extended by synesketch.emotion.AffectWord

public class AffectWord
extends java.lang.Object

Represents one unit from the Synesketch Lexicon: a word associated with emotional meaning, and it's emotional weights and valence.

Synesketch Lexicon, which consits of several thousand words (with emoticons), associates these atributes to a word:

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

Constructor Summary
AffectWord(java.lang.String word)
          Class constructor which sets the affect word
AffectWord(java.lang.String word, double generalWeight, double happinessWeight, double sadnessWeight, double angerWeight, double fearWeight, double disgustWeight, double surpriseWeight)
          Class constructor which sets the affect word and it's weights.
AffectWord(java.lang.String word, double generalWeight, double happinessWeight, double sadnessWeight, double angerWeight, double fearWeight, double disgustWeight, double surpriseWeight, double quoficient)
          Class constructor which sets the affect word and it's weights, adjusted by the quoeficient.
 
Method Summary
 void adjustWeights(double quoficient)
          Adjusts weights by the certain quoficient.
 AffectWord clone()
          Makes duplicate of the object.
 void flipValence()
          Flips valence of the word -- calculates change from postive to negative emotion.
 double getAngerWeight()
          Getter for the anger weight.
 double getDisgustWeight()
          Getter for the disgust weight.
 double getFearWeight()
          Getter for the fear weight.
 double getGeneralValence()
          Getter for the general valence.
 double getGeneralWeight()
          Getter for the general weight.
 double getHappinessWeight()
          Getter for the happiness weight.
 double getSadnessWeight()
          Getter for the sadness weight.
 double getSurpriseWeight()
          Getter for the surprise weight.
 java.lang.String getWord()
          Getter for the word.
 boolean isZeroEkman()
          Sets the boolean value which determines does a word have specific emotional weight for emotion types defined by Ekman: happiness, sadness, fear, anger, disgust, and surprise.
 void setAngerWeight(double angerWeight)
          Getter for the anger weight.
 void setDisgustWeight(double disgustWeight)
          Setter for the disgust weight.
 void setFearWeight(double fearWeight)
          Getter for the fear weight.
 void setGeneralValence(int generalValence)
          Setter for the general valence
 void setGeneralWeight(double generalWeight)
          Setter for the general weight.
 void setHappinessWeight(double happinessWeight)
          Setter for the happiness weight.
 void setSadnessWeight(double sadnessWeight)
          Setter for the sadness weight.
 void setStartsWithEmoticon(boolean startsWithEmoticon)
          Sets does the word start with emoticon.
 void setSurpriseWeight(double surpriseWeight)
          Setter for the surprise weight.
 boolean startsWithEmoticon()
          Returns true if the word starts with the emoticon.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AffectWord

public AffectWord(java.lang.String word)
Class constructor which sets the affect word

Parameters:
word - String representing the word

AffectWord

public AffectWord(java.lang.String word,
                  double generalWeight,
                  double happinessWeight,
                  double sadnessWeight,
                  double angerWeight,
                  double fearWeight,
                  double disgustWeight,
                  double surpriseWeight)
Class constructor which sets the affect word and it's weights. Valence is calculated as a function of different emotion type weights.

Parameters:
word - String representing the word
generalWeight - double representing the general emotional weight
happinessWeight - double representing the happiness weight
sadnessWeight - double representing the sadness weight
angerWeight - double representing the anger weight
fearWeight - double representing the fear weight
disgustWeight - double representing the disgust weight
surpriseWeight - double representing the surprise weight

AffectWord

public AffectWord(java.lang.String word,
                  double generalWeight,
                  double happinessWeight,
                  double sadnessWeight,
                  double angerWeight,
                  double fearWeight,
                  double disgustWeight,
                  double surpriseWeight,
                  double quoficient)
Class constructor which sets the affect word and it's weights, adjusted by the quoeficient. Valence is calculated as a function of different emotion type weights.

Parameters:
word - String representing the word
generalWeight - double representing the general emotional weight
happinessWeight - double representing the happiness weight
sadnessWeight - double representing the sadness weight
angerWeight - double representing the anger weight
fearWeight - double representing the fear weight
disgustWeight - double representing the disgust weight
surpriseWeight - double representing the surprise weight
quoficient - double representing the quoficient for adjusting the weights
Method Detail

adjustWeights

public void adjustWeights(double quoficient)
Adjusts weights by the certain quoficient.

Parameters:
quoficient - double representing the quoficient for adjusting the weights

flipValence

public void flipValence()
Flips valence of the word -- calculates change from postive to negative emotion.


clone

public AffectWord clone()
Makes duplicate of the object.

Overrides:
clone in class java.lang.Object
Returns:
AffectWord, new duplicated object

startsWithEmoticon

public boolean startsWithEmoticon()
Returns true if the word starts with the emoticon.

Returns:
boolean (true if the word starts with the emoticon, false if not)

setStartsWithEmoticon

public void setStartsWithEmoticon(boolean startsWithEmoticon)
Sets does the word start with emoticon.

Parameters:
startsWithEmoticon - boolean (true if the word starts with the emoticon, false if not)

getAngerWeight

public double getAngerWeight()
Getter for the anger weight.

Returns:
double which represents the anger weight

setAngerWeight

public void setAngerWeight(double angerWeight)
Getter for the anger weight.

Parameters:
angerWeight - double which represents the anger weight

getDisgustWeight

public double getDisgustWeight()
Getter for the disgust weight.

Returns:
double which represents the disgust weight

setDisgustWeight

public void setDisgustWeight(double disgustWeight)
Setter for the disgust weight.

Parameters:
disgustWeight - double which represents the disgust weight

getFearWeight

public double getFearWeight()
Getter for the fear weight.

Returns:
double which represents the fear weight

setFearWeight

public void setFearWeight(double fearWeight)
Getter for the fear weight.

Parameters:
fearWeight - double which represents the fear weight

getHappinessWeight

public double getHappinessWeight()
Getter for the happiness weight.

Returns:
double which represents the happiness weight

setHappinessWeight

public void setHappinessWeight(double happinessWeight)
Setter for the happiness weight.

Parameters:
happinessWeight - double which represents the happiness weight

getSadnessWeight

public double getSadnessWeight()
Getter for the sadness weight.

Returns:
double which represents the sadness weight

setSadnessWeight

public void setSadnessWeight(double sadnessWeight)
Setter for the sadness weight.

Parameters:
sadnessWeight - double which represents the sadness weight

getSurpriseWeight

public double getSurpriseWeight()
Getter for the surprise weight.

Returns:
double which represents the surprise weight

setSurpriseWeight

public void setSurpriseWeight(double surpriseWeight)
Setter for the surprise weight.

Parameters:
surpriseWeight - double which represents the surprise weight

getWord

public java.lang.String getWord()
Getter for the word.

Returns:
String which represents the word

getGeneralWeight

public double getGeneralWeight()
Getter for the general weight.

Returns:
double which represents the general weight

setGeneralWeight

public void setGeneralWeight(double generalWeight)
Setter for the general weight.

Parameters:
generalWeight - double which represents the general weight

getGeneralValence

public double getGeneralValence()
Getter for the general valence.

Returns:
double which represents the general valence

setGeneralValence

public void setGeneralValence(int generalValence)
Setter for the general valence

Parameters:
generalValence - double which represents the general valence

isZeroEkman

public boolean isZeroEkman()
Sets the boolean value which determines does a word have specific emotional weight for emotion types defined by Ekman: happiness, sadness, fear, anger, disgust, and surprise.

Returns:
boolean value, true if all specific emotional weight have the value of zero

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object