package com.github.bot.curiosone.core.analysis;

import com.github.bot.curiosone.core.nlp.Phrase;

/**
 * Handles emotion analysis for a Phrase.
 * Provides a single public static method to perform to calculate the emotion of a given Phrase.
 */
public class EmotionAnalysis {

  /**
   * Private constructor.
   */
  private EmotionAnalysis() {}

  /**
   * Performs an emotion analysis of the provided Phrase.
   * @param p the Phrase to be analysed.
   * @return a String representation of the calculated emotion. Supports "sad", "happy" and "angry"
   */
  public static String getEmotion(Phrase p) {
    //TODO: Add implementation.
    return "";
  }
}

@@ -418,16 +418,21 @@
 @param p
+hrase
  the Phr
@@ -603,16 +603,21 @@
 se p
+hrase
 ) %7B%0A    
 //TO
@@ -616,35 +616,142 @@
     
-//TODO: Add implementation.
+double score = TokenScorer.calculateScore(phrase.getTokens());%0A    if (score %3C= -0.5) return %22angry%22;%0A    if (score %3C 0) return %22sad%22;
 %0A   
@@ -759,16 +759,21 @@
 return %22
+happy
 %22;%0A  %7D%0A%7D

Add base implementation of getEmotion method