Class Opinion

java.lang.Object
com.lexalytics.salience.Opinion

public class Opinion
extends java.lang.Object

An Opinion object represents a connection between a speaker and a topic for which an opinion is being expressed. This generally includes a quotation by the speaker.

  • Constructor Summary

    Constructors 
    Constructor Description
    Opinion​(java.lang.String sSpeaker, java.lang.String sTopic, java.lang.String sQuotation, float fSentiment, boolean bIsTheme)
    Creates a new opinion object.
  • Method Summary

    Modifier and Type Method Description
    boolean getIsTheme()
    Retrieves whether the opinion is about a theme (as opposed to an entity).
    java.lang.String getQuotation()
    Retrieves a quotation related to the opinion, if one exists.
    float getSentiment()
    Retrieves the sentiment of the opinion.
    java.lang.String getSpeaker()
    Retrieves the speaker of the opinion.
    java.lang.String getTopic()
    Retrieves the subject of the opinion.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Opinion

      public Opinion​(java.lang.String sSpeaker, java.lang.String sTopic, java.lang.String sQuotation, float fSentiment, boolean bIsTheme)
      Creates a new opinion object. This is not intended for client use. Opinions are created by Salience Engine to provide results for the Salience.getNamedEntityOpinions() and Salience.getUserEntityOpinions() API methods.
      Parameters:
      sSpeaker - The speaker of the opinion.
      sTopic - The subject of the opinion.
      sQuotation - A quotation (if available) related to the opinion.
      fSentiment - The sentiment associated with the opinion.
      bIsTheme - Communicates that the opinion is about a theme (as opposed to an entity)
  • Method Details

    • getSpeaker

      public java.lang.String getSpeaker()
      Retrieves the speaker of the opinion.
      Returns:
      A String containing the speaker of the opinion.
    • getTopic

      public java.lang.String getTopic()
      Retrieves the subject of the opinion.
      Returns:
      A String containing the subject of the opinion.
    • getQuotation

      public java.lang.String getQuotation()
      Retrieves a quotation related to the opinion, if one exists.
      Returns:
      A String containing a quotation related to the opinion.
    • getSentiment

      public float getSentiment()
      Retrieves the sentiment of the opinion.
      Returns:
      The sentiment score for the opinion.
    • getIsTheme

      public boolean getIsTheme()
      Retrieves whether the opinion is about a theme (as opposed to an entity).
      Returns:
      true if the opinion is about a theme.