public class WeightedBipolarSentiment extends Object implements Sentiment, BipolarSentimentProvider, ScalarArithmetic<WeightedBipolarSentiment,Double>, ObjectArithmetic<WeightedBipolarSentiment>
Constructor and Description |
---|
WeightedBipolarSentiment()
all weights set to 0
|
WeightedBipolarSentiment(double positive,
double negative,
double neutral) |
public WeightedBipolarSentiment()
public WeightedBipolarSentiment(double positive, double negative, double neutral)
positive
- the positivenegative
- the negativeneutral
- the neutralpublic double positive()
public double negative()
public double 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 addInplace(WeightedBipolarSentiment that)
ObjectArithmetic
addInplace
in interface ObjectArithmetic<WeightedBipolarSentiment>
that
- add s to thispublic WeightedBipolarSentiment add(WeightedBipolarSentiment that)
ObjectArithmetic
add
in interface ObjectArithmetic<WeightedBipolarSentiment>
that
- add s to a copy of thispublic WeightedBipolarSentiment divide(WeightedBipolarSentiment that)
ObjectArithmetic
divide
in interface ObjectArithmetic<WeightedBipolarSentiment>
that
- divide a copy of this by spublic WeightedBipolarSentiment divideInplace(WeightedBipolarSentiment that)
ObjectArithmetic
divideInplace
in interface ObjectArithmetic<WeightedBipolarSentiment>
that
- divide this by spublic WeightedBipolarSentiment clone()
public double total()
public WeightedBipolarSentiment add(Double f)
ScalarArithmetic
add
in interface ScalarArithmetic<WeightedBipolarSentiment,Double>
f
- add s to a copy of thispublic WeightedBipolarSentiment addInplace(Double f)
ScalarArithmetic
addInplace
in interface ScalarArithmetic<WeightedBipolarSentiment,Double>
f
- add s to thispublic WeightedBipolarSentiment divide(Double d)
ScalarArithmetic
divide
in interface ScalarArithmetic<WeightedBipolarSentiment,Double>
d
- divide a copy of this by spublic WeightedBipolarSentiment divideInplace(Double d)
ScalarArithmetic
divideInplace
in interface ScalarArithmetic<WeightedBipolarSentiment,Double>
d
- divide this by spublic WeightedBipolarSentiment subtract(WeightedBipolarSentiment s)
ObjectArithmetic
subtract
in interface ObjectArithmetic<WeightedBipolarSentiment>
s
- minus a copy of this by spublic WeightedBipolarSentiment subtractInplace(WeightedBipolarSentiment f)
ObjectArithmetic
subtractInplace
in interface ObjectArithmetic<WeightedBipolarSentiment>
f
- minus this by spublic WeightedBipolarSentiment multiply(WeightedBipolarSentiment that)
ObjectArithmetic
multiply
in interface ObjectArithmetic<WeightedBipolarSentiment>
that
- times a copy of this by spublic WeightedBipolarSentiment multiplyInplace(WeightedBipolarSentiment that)
ObjectArithmetic
multiplyInplace
in interface ObjectArithmetic<WeightedBipolarSentiment>
that
- times this by spublic WeightedBipolarSentiment multiply(Double value)
ScalarArithmetic
multiply
in interface ScalarArithmetic<WeightedBipolarSentiment,Double>
value
- times a copy of this by spublic WeightedBipolarSentiment multiplyInplace(Double value)
ScalarArithmetic
multiplyInplace
in interface ScalarArithmetic<WeightedBipolarSentiment,Double>
value
- times this by spublic WeightedBipolarSentiment subtract(Double s)
ScalarArithmetic
subtract
in interface ScalarArithmetic<WeightedBipolarSentiment,Double>
s
- minus a copy of this by spublic WeightedBipolarSentiment subtractInplace(Double s)
ScalarArithmetic
subtractInplace
in interface ScalarArithmetic<WeightedBipolarSentiment,Double>
s
- minus this by spublic boolean containsNaN()
public WeightedBipolarSentiment logInplace()
public void neutral(double neutral)
neutral
- public void negative(double negative)
negative
- public void positive(double positive)
positive
- public void correctNaN(double d)
d
- set NaN instances to this valuepublic WeightedBipolarSentiment expInplace()
Math.exp(double)
each value inplacepublic WeightedBipolarSentiment clipMaxInplace(double d)
d
-