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

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

import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
 * Stores a response from Curiosone's Brain.
 * Provides useful methods to create a BrainResponse and to retrieve its information.
 */
public class BrainResponse {

  /**
  * Stores the content of the computed answer.
  */
  private String text;

  /**
   * Stores the scope of the computed answer.
   */
  private String scope;

  /**
   * Constructs a BrainResponse instance, containing a text and a scope.
   * @param text The content of the computed answer
   * @param scope The scope of the computed answer
   */
  public BrainResponse(String text, String scope) {
    this.text = text;
    this.scope = scope;
  }

  /**
   * Returns the content of the computed answer.
   */
  public String getMessage() {
    return text;
  }

  /**
   * Returns the scope of the computed answer.
   */
  public String getScope() {
    return scope;
  }

  /**
   * Returns a String representation of this BrainResponse.
   */
  @Override
  public String toString() {
    return text + "(" + scope + ")";
  }

  /**
   * Checks whether this BrainResponse equals to the given Object or not.
   * @param other the other response to be compared against
   * @return {@code true} if this response equals the other response;
   *         {@code false} otherwise
   */
  @Override
  public boolean equals(Object other) {
    if (other == this) {
      return true;
    }
    if (other == null || other.getClass() != this.getClass()) {
      return false;
    }
    BrainResponse that = (BrainResponse) other;
    return this.text.equals(that.text) && this.scope.equals(that.scope);
  }

  /**
   * Returns the HashCode for this BrainResponse.
   * The HashCode depends on the content and the scope of this BrainResponse.
   */
  @Override
  public int hashCode() {
    return Objects.hash(text, scope);
  }
}

@@ -603,20 +603,34 @@
  @param 
+ 
 text
+%0A   *        
  The con
@@ -669,21 +669,35 @@
  @param 
+ 
 scope
+%0A   *        
  The sco
@@ -838,31 +838,32 @@
 %0A  /**%0A   * 
-R
+@r
 eturn
-s
+ 
  the content
@@ -953,31 +953,32 @@
 %0A  /**%0A   * 
-R
+@r
 eturn
-s
+ 
  the scope o
@@ -1069,23 +1069,24 @@
 **%0A   * 
-R
+@r
 eturn
-s
+ 
  a Strin
@@ -1306,21 +1306,35 @@
  @param 
+ 
 other
+%0A   *        
  the oth
@@ -1332,25 +1332,30 @@
   the other 
-r
+BrainR
 esponse to b
@@ -1386,16 +1386,17 @@
 @return 
+ 
 %7B@code t
@@ -1408,17 +1408,22 @@
 if this 
-r
+BrainR
 esponse 
@@ -1439,17 +1439,22 @@
 e other 
-r
+BrainR
 esponse;
@@ -1454,24 +1454,25 @@
 sponse;%0A   *
+ 
          %7B@c
@@ -1868,24 +1868,24 @@
 inResponse.%0A
-
    * The Has
@@ -1942,32 +1942,119 @@
  BrainResponse.%0A
+   * @see  %3Ca href=%22https://goo.gl/inr6Ra%22%3EThe hashCode method of the Object Class%3C/a%3E%0A
    */%0A  @Overrid

improve BrainResponse javadoc