package org.studiorailgun.transfer;

import static org.junit.jupiter.api.Assertions.*;

import org.junit.Test;
import org.studiorailgun.Globals;
import org.studiorailgun.ai.conversation.parser.NLPParser;
import org.studiorailgun.ai.conversation.parser.depend.Clause;
import org.studiorailgun.ai.conversation.tracking.Quote;
import org.studiorailgun.ai.conversation.tracking.Sentence;

/**
 * Transfer statement parsing tests
 */
public class TransferParsingTests {
    
    @Test
    public void testParse1(){
        Globals.init("./data/webs/test/web.json");
        Quote input = new Quote("My name is John.");
        NLPParser.parse(input);
        Sentence sentence = input.getSentences().get(0);
        Clause mainClause = sentence.getMainClause();

        //has a copular verb
        assertEquals(mainClause.getPredicate().getRoot().originalText(),"John");
        assertEquals(mainClause.getPredicate().getCopular().originalText(),"is");
        assertEquals(mainClause.getSubject().getRoot().originalText(), "name");
        assertEquals(mainClause.getSubject().getPossessiveModifier().originalText(), "My");
    }

}
