public class DiscreteCountBipolarSentiment extends Object implements Sentiment, BipolarSentimentProvider, WeightedBipolarSentimentProvider, ScalarArithmetic<DiscreteCountBipolarSentiment,Integer>, ObjectArithmetic<DiscreteCountBipolarSentiment>
Modifier and Type | Field and Description |
---|---|
static DiscreteCountBipolarSentiment |
NEGATIVE
a single negative count
|
static DiscreteCountBipolarSentiment |
NEUTRAL
a single neutral count
|
static DiscreteCountBipolarSentiment |
POSITIVE
A single positive count
|
Constructor and Description |
---|
DiscreteCountBipolarSentiment()
all weights set to 0
|
DiscreteCountBipolarSentiment(int positive,
int negative,
int neutral) |
DiscreteCountBipolarSentiment(int positive,
int negative,
int neutral,
int total) |
public static final DiscreteCountBipolarSentiment POSITIVE
public static final DiscreteCountBipolarSentiment NEGATIVE
public static final DiscreteCountBipolarSentiment NEUTRAL
public DiscreteCountBipolarSentiment()
public DiscreteCountBipolarSentiment(int positive, int negative, int neutral, int total) throws InvalidSentimentException
positive
- the positivenegative
- the negativeneutral
- the neutraltotal
- the total number of termsInvalidSentimentException
public DiscreteCountBipolarSentiment(int positive, int negative, int neutral)
positive
- the positivenegative
- the negativeneutral
- the neutralpublic int positive()
public int negative()
public int neutral()
public BipolarSentiment bipolar()
bipolar
in interface BipolarSentimentProvider
public BipolarSentiment bipolar(double deltaThresh)
bipolar
in interface BipolarSentimentProvider
deltaThresh
- A a proportional thresholdpublic void fromMap(Map<String,?> map) throws UnrecognisedMapException
fromMap
in interface Sentiment
map
- the map containing this sentimentUnrecognisedMapException
public WeightedBipolarSentiment weightedBipolar()
weightedBipolar
in interface WeightedBipolarSentimentProvider
protected DiscreteCountBipolarSentiment clone()
public DiscreteCountBipolarSentiment addInplace(DiscreteCountBipolarSentiment s)
ObjectArithmetic
addInplace
in interface ObjectArithmetic<DiscreteCountBipolarSentiment>
s
- add s to thispublic DiscreteCountBipolarSentiment multiplyInplace(DiscreteCountBipolarSentiment s)
ObjectArithmetic
multiplyInplace
in interface ObjectArithmetic<DiscreteCountBipolarSentiment>
s
- times this by spublic DiscreteCountBipolarSentiment divideInplace(DiscreteCountBipolarSentiment s)
ObjectArithmetic
divideInplace
in interface ObjectArithmetic<DiscreteCountBipolarSentiment>
s
- divide this by spublic DiscreteCountBipolarSentiment add(DiscreteCountBipolarSentiment s)
ObjectArithmetic
add
in interface ObjectArithmetic<DiscreteCountBipolarSentiment>
s
- add s to a copy of thispublic DiscreteCountBipolarSentiment subtract(DiscreteCountBipolarSentiment s)
ObjectArithmetic
subtract
in interface ObjectArithmetic<DiscreteCountBipolarSentiment>
s
- minus a copy of this by spublic DiscreteCountBipolarSentiment subtractInplace(DiscreteCountBipolarSentiment s)
ObjectArithmetic
subtractInplace
in interface ObjectArithmetic<DiscreteCountBipolarSentiment>
s
- minus this by spublic DiscreteCountBipolarSentiment multiply(DiscreteCountBipolarSentiment s)
ObjectArithmetic
multiply
in interface ObjectArithmetic<DiscreteCountBipolarSentiment>
s
- times a copy of this by spublic DiscreteCountBipolarSentiment divide(DiscreteCountBipolarSentiment s)
ObjectArithmetic
divide
in interface ObjectArithmetic<DiscreteCountBipolarSentiment>
s
- divide a copy of this by spublic DiscreteCountBipolarSentiment addInplace(Integer s)
ScalarArithmetic
addInplace
in interface ScalarArithmetic<DiscreteCountBipolarSentiment,Integer>
s
- add s to thispublic DiscreteCountBipolarSentiment multiplyInplace(Integer s)
ScalarArithmetic
multiplyInplace
in interface ScalarArithmetic<DiscreteCountBipolarSentiment,Integer>
s
- times this by spublic DiscreteCountBipolarSentiment divideInplace(Integer s)
ScalarArithmetic
divideInplace
in interface ScalarArithmetic<DiscreteCountBipolarSentiment,Integer>
s
- divide this by spublic DiscreteCountBipolarSentiment add(Integer s)
ScalarArithmetic
add
in interface ScalarArithmetic<DiscreteCountBipolarSentiment,Integer>
s
- add s to a copy of thispublic DiscreteCountBipolarSentiment subtract(Integer s)
ScalarArithmetic
subtract
in interface ScalarArithmetic<DiscreteCountBipolarSentiment,Integer>
s
- minus a copy of this by spublic DiscreteCountBipolarSentiment subtractInplace(Integer s)
ScalarArithmetic
subtractInplace
in interface ScalarArithmetic<DiscreteCountBipolarSentiment,Integer>
s
- minus this by spublic DiscreteCountBipolarSentiment multiply(Integer s)
ScalarArithmetic
multiply
in interface ScalarArithmetic<DiscreteCountBipolarSentiment,Integer>
s
- times a copy of this by spublic DiscreteCountBipolarSentiment divide(Integer s)
ScalarArithmetic
divide
in interface ScalarArithmetic<DiscreteCountBipolarSentiment,Integer>
s
- divide a copy of this by s