Class Sentence

java.lang.Object
com.lexalytics.salience.Sentence

public class Sentence
extends java.lang.Object

The Sentence object contains information about a single sentence in the document content.

  • Constructor Summary

    Constructors 
    Constructor Description
    Sentence​(java.util.Vector<Word> vWords, java.util.Vector<Chunk> vChunks, boolean bSubjective, java.lang.String sText, boolean bPolar, boolean bImperative, int nSummaryRank, float fSentiment)
    Creates a new Sentence object.
  • Method Summary

    Modifier and Type Method Description
    java.util.Vector<Chunk> getChunks()
    Retrieves a list of the Chunk items within the sentence.
    float getSentiment()
    Retrieves the sentiment score of the sentence.
    int getSummaryRank()
    Retrieves the ranking of the sentence with regards to summary.
    java.lang.String getText()
    Retrieves the text of the sentence.
    java.util.Vector<Word> getWords()
    Retrieves a list of the Word items within the sentence.
    boolean isImperative()
    Added in Salience 5.1: Retrieves an indication of whether or not the sentence content contains an imperative, or call-to-action, statement.
    boolean isPolar()
    Added in Salience 5.1: Retrieves an indication of whether or not the sentence content contains sentiment polarity.
    boolean isSubjective()
    Retrieves an indication of whether or not the sentence content is subjective or not.

    Methods inherited from class java.lang.Object

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

    • Sentence

      public Sentence​(java.util.Vector<Word> vWords, java.util.Vector<Chunk> vChunks, boolean bSubjective, java.lang.String sText, boolean bPolar, boolean bImperative, int nSummaryRank, float fSentiment)
      Creates a new Sentence object. This is not intended for client use, these objects are created by Salience Engine and added to the DocumentDetails object.
      Parameters:
      vWords - The words in the sentence.
      vChunks - The chunks in the sentence.
      bSubjective - An indicator if the sentence contains subjective content.
      sText - The text of the sentence.
      bPolar - An indicator if the sentence contains sentiment polarity.
      bImperative - An indicator if the sentence contains an imperative, or call to action, statement.
      fSentiment - The sentiment score of the sentence.
  • Method Details

    • getWords

      public java.util.Vector<Word> getWords()
      Retrieves a list of the Word items within the sentence.
      Returns:
      A Vector of Salience Word objects.
    • getChunks

      public java.util.Vector<Chunk> getChunks()
      Retrieves a list of the Chunk items within the sentence.
      Returns:
      A Vector of Salience Chunk objects.
    • isSubjective

      public boolean isSubjective()
      Retrieves an indication of whether or not the sentence content is subjective or not.
      Returns:
      A boolean flag indicating if the sentence is subjective.
    • isPolar

      public boolean isPolar()
      Added in Salience 5.1: Retrieves an indication of whether or not the sentence content contains sentiment polarity.
      Returns:
      A boolean flag indicating if the sentence contains polarity.
    • isImperative

      public boolean isImperative()
      Added in Salience 5.1: Retrieves an indication of whether or not the sentence content contains an imperative, or call-to-action, statement.
      Returns:
      A boolean flag indicating if the sentence is imperative.
    • getSummaryRank

      public int getSummaryRank()
      Retrieves the ranking of the sentence with regards to summary. Must call getSummary to initialize.
      Returns:
      An integer indicating the rank of the sentence relative to summary.
    • getSentiment

      public float getSentiment()
      Retrieves the sentiment score of the sentence.
      Returns:
      A float indicating the sentiment score of the sentence.
    • getText

      public java.lang.String getText()
      Retrieves the text of the sentence.
      Returns:
      A String containing the sentence text.