package org.studiorailgun.conversation.tracking;

import java.util.LinkedList;
import java.util.List;

import edu.stanford.nlp.pipeline.CoreDocument;

/**
 * A quote stated during the conversation
 */
public class Quote {
    
    /**
     * The raw text of the quote
     */
    String raw;

    /**
     * The CoreNLP parsed document
     */
    CoreDocument parsedDocument;

    /**
     * The list of sentences in this quote
     */
    List<Sentence> sentences;

    /**
     * Constructor
     * @param input The raw text of the quote
     */
    public Quote(String input){
        this.raw = input;
        this.sentences = new LinkedList<Sentence>();
    }

    /**
     * Gets the raw text of the quote
     * @return The raw text of the quote
     */
    public String getRaw(){
        return raw;
    }

    public CoreDocument getParsedDocument() {
        return parsedDocument;
    }

    public void setParsedDocument(CoreDocument parsedDocument) {
        this.parsedDocument = parsedDocument;
    }

    public List<Sentence> getSentences(){
        return sentences;
    }

    public void addSentence(Sentence sentence){
        this.sentences.add(sentence);
    }

    /**
     * Appends a sentence to the quote (including adding its raw text to the raw text of the quote)
     * @param sentence The sentence
     */
    public void appendSentence(Sentence sentence){
        this.sentences.add(sentence);
        if(this.raw.length() > 0){
            this.raw = this.raw + " ";
        }
        this.raw = this.raw + sentence.getRaw();
    }
    

}
