Class ParallelDots

  • All Implemented Interfaces:
    EmotionAnalysisAPI

    public class ParallelDots
    extends java.lang.Object
    implements EmotionAnalysisAPI
    This class contains a method to execute the sentiment analysis with ParallelDots API.
    Author:
    Ariadna de Arriba
    • Constructor Summary

      Constructors 
      Constructor Description
      ParallelDots​(java.lang.String apiKey)
      Constructor.
    • Method Summary

      Modifier and Type Method Description
      java.lang.String emotion​(java.lang.String text)
      Make a request to ParallelDots for sentiment analysis.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ParallelDots

        public ParallelDots​(java.lang.String apiKey)
        Constructor.
        Parameters:
        apiKey - Api-key to authorize the method.
    • Method Detail

      • emotion

        public java.lang.String emotion​(java.lang.String text)
                                 throws java.lang.NullPointerException,
                                        java.io.IOException
        Make a request to ParallelDots for sentiment analysis.
        Specified by:
        emotion in interface EmotionAnalysisAPI
        Parameters:
        text - Text to analyze.
        Returns:
        Returns a string that contains a json with each of six emotions weighted.
        Throws:
        java.lang.NullPointerException - caused by an error during a call to the API and returns nothing.
        java.io.IOException - caused by an error in the API call.