package org.studiorailgun.conversation.parser.depend;

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

import edu.stanford.nlp.ling.IndexedWord;

/**
 * A linguistic predicate
 */
public class Predicate {

    /**
     * The types of nonverbal predicates that can exist
     */
    public static enum NonVerbalPredicateType {

        /**
         * Stating an identity/equality (He is my father)
         */
        EQUATION,

        /**
         * Attributing a value to something (She is intelligent)
         */
        ATTRIBUTION,

        /**
         * Quantifying something (There are two)
         */
        QUANTIFICATION,

        /**
         * Stating the location of something (The book is above the bed)
         */
        LOCATION,

        /**
         * Stating the possessor of something (The can is hers)
         */
        POSSESSION,

        /**
         * Stating the benefactor of something (The car is his)
         */
        BENEFACTION,

        /**
         * Stating the existence of something (There is a god)
         */
        EXISTENCE,
    }
    
    /**
     * The root of the predicate
     */
    IndexedWord root;

    /**
     * The list of adverbs
     */
    List<Adverb> adverbs = new LinkedList<Adverb>();


    /**
     * The predicate is existential. Essentially, this means that the sentence is declaring the existence of the subject.
     */
    boolean existential;

    /**
     * The auxiliary verb for this predicate
     */
    IndexedWord auxiliary;

    /**
     * The phrasal verb particle for this predicate
     */
    IndexedWord phrasalVerbParticle;

    /**
     * The nonverbal predicate type
     */
    NonVerbalPredicateType nonVerbalType;

    /**
     * Constructor
     * @param root The root of the predicate
     */
    public Predicate(IndexedWord root){
        this.root = root;
    }

    /**
     * Gets the root of this predicate
     * @return The root
     */
    public IndexedWord getRoot(){
        return root;
    }

    /**
     * Adds an adverb to the predicate
     * @param adverb The adverb
     */
    public void addAdverb(Adverb adverb){
        this.adverbs.add(adverb);
    }

    /**
     * Gets the adverbs modifying this predicate
     * @return The list of adverbs
     */
    public List<Adverb> getAdverbs(){
        return adverbs;
    }

    /**
     * Sets the copular for this predicate
     * @param copularWord The copular word
     */
    public void setCopular(IndexedWord copularWord){

    }

    /**
     * Sets the existential status of the predicate
     * @param existential true if existential, false otherwise
     */
    public void setExistential(boolean existential){
        this.existential = existential;
    }

    /**
     * Checks if this is an existential predicate or not
     * @return true if is existential, false otherwise
     */
    public boolean isExistential(){
        return existential;
    }

    /**
     * Sets the auxiliary verb for this predicate
     * @param auxiliary The auxiliary verb
     */
    public void setAuxiliary(IndexedWord auxiliary){
        this.auxiliary = auxiliary;
    }

    /**
     * Sets the phrasal verb particle for the predicate
     * @param phrasalVerbParticle the phrasal very particle
     */
    public void setPhrasalVerbParticle(IndexedWord phrasalVerbParticle){
        this.phrasalVerbParticle = phrasalVerbParticle;
    }

}
