Class Facet

java.lang.Object
com.lexalytics.salience.Facet

public class Facet
extends java.lang.Object

A Facet object represents a connection between a noun and other nouns or adjectives in a collection. Facets can be considered the subject of conversation and contain Attribute objects they are connected to.

  • Constructor Summary

    Constructors 
    Constructor Description
    Facet​(java.lang.String sFacet, int nCount, int nPositiveCount, int nNeutralCount, int nNegativeCount, java.util.Vector<Attribute> vAttributes, java.util.Vector<Phrase> vMentions, java.util.Vector<Phrase> vPositiveMentions, java.util.Vector<Phrase> vNegativeMentions, java.util.Vector<Phrase> vNeutralMentions)
    Creates a new facet.
  • Method Summary

    Modifier and Type Method Description
    java.util.Vector<Attribute> getAttributes()
    Retrieves the attributes for the facet.
    int getCount()
    Retrieve a count of the number of occurrences of the facet throughout the collection.
    java.lang.String getLabel()
    Retrieves the text of the facet.
    java.util.Vector<Phrase> getMentions()
    Retrieves the individual mentions for the facet.
    int getNegativeCount()
    Retrieves the number of negative occurrences of the facet across all collection documents.
    java.util.Vector<Phrase> getNegativeMentions()
    Retrieves the individual negative mentions for the facet.
    int getNeutralCount()
    Retrieves the number of neutral occurrences of the facet across all collection documents.
    java.util.Vector<Phrase> getNeutralMentions()
    Retrieves the individual neutral mentions of the facet.
    int getPositiveCount()
    Retrieves the number of positive occurrences of the facet across all collection documents.
    java.util.Vector<Phrase> getPositiveMentions()
    Retrieves the individual positive mentions for the facet.

    Methods inherited from class java.lang.Object

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

    • Facet

      public Facet​(java.lang.String sFacet, int nCount, int nPositiveCount, int nNeutralCount, int nNegativeCount, java.util.Vector<Attribute> vAttributes, java.util.Vector<Phrase> vMentions, java.util.Vector<Phrase> vPositiveMentions, java.util.Vector<Phrase> vNegativeMentions, java.util.Vector<Phrase> vNeutralMentions)
      Creates a new facet. This is not intended for client use. Facets are created by Salience Engine when a SalienceCollections.getCollectionFacets() API method is called.
      Parameters:
      sFacet - The text of the facet.
      nCount - A count of the occurrences of the facet.
      nPositiveCount - The number of occurrences that contain positive sentiment for the facet.
      nNegativeCount - The number of occurrences that contain negative sentiment for the facet.
      nNeutralCount - The number of occurrences that contain neutral sentiment for the facet.
      vAttributes - A list of attributes associated with the facet.
      vMentions - A list of facet mentions.
      vPositiveMentions - A list of positive facet mentions.
      vNegativeMentions - A list of negative facet mentions.
      vNeutralMentions - A list of neutral facet mentions.
  • Method Details

    • getLabel

      public java.lang.String getLabel()
      Retrieves the text of the facet.
      Returns:
      A String containing the text of the facet.
    • getCount

      public int getCount()
      Retrieve a count of the number of occurrences of the facet throughout the collection.
      Returns:
      The count associated with the facet.
    • getPositiveCount

      public int getPositiveCount()
      Retrieves the number of positive occurrences of the facet across all collection documents. This is dependent on the neutral range set by the Options.SentimentOptions.SetSentimentThresholds(float, float) API call.
      Returns:
      The number of positive occurrences for this facet.
    • getNeutralCount

      public int getNeutralCount()
      Retrieves the number of neutral occurrences of the facet across all collection documents. This is dependent on the neutral range set by the Options.SentimentOptions.SetSentimentThresholds(float, float) API call.
      Returns:
      The number of neutral occurrences for this facet.
    • getNegativeCount

      public int getNegativeCount()
      Retrieves the number of negative occurrences of the facet across all collection documents. This is dependent on the neutral range set by the Options.SentimentOptions.SetSentimentThresholds(float, float) API call.
      Returns:
      The number of negative occurrences for this facet.
    • getAttributes

      public java.util.Vector<Attribute> getAttributes()
      Retrieves the attributes for the facet.
      Returns:
      A Vector of Attribute objects associated with the facet.
    • getMentions

      public java.util.Vector<Phrase> getMentions()
      Retrieves the individual mentions for the facet.
      Returns:
      A Vector of Phrase objects which contain information about the individual mentions of the facet.
    • getPositiveMentions

      public java.util.Vector<Phrase> getPositiveMentions()
      Retrieves the individual positive mentions for the facet.
      Returns:
      A Vector of Phrase objects which contain information about the positive mentions of the facet.
    • getNegativeMentions

      public java.util.Vector<Phrase> getNegativeMentions()
      Retrieves the individual negative mentions for the facet.
      Returns:
      A Vector of Phrase objects which contain information about the negative mentions of the facet.
    • getNeutralMentions

      public java.util.Vector<Phrase> getNeutralMentions()
      Retrieves the individual neutral mentions of the facet.
      Returns:
      A Vector of Phrase objects which contain information about the neutral mentions of the facet.