Search in sources :

Example 6 with InteractiveTableTuple

use of main.database.InteractiveTableTuple in project Info-Evaluation by TechnionYP5777.

the class InteractiveTableTupleTest method test1.

@Test
public void test1() {
    InteractiveTableTuple t = new InteractiveTableTuple("Justin Bieber", "12/02/2016", null);
    assertEquals(t.getDate(), "12/02/2016");
    assertEquals(t.getName(), "Justin Bieber");
    assertEquals((t.getRegularDate() + ""), "Fri Dec 02 00:00:00 IST 2016");
    assert t.getKeyWords().isEmpty();
}
Also used : InteractiveTableTuple(main.database.InteractiveTableTuple) Test(org.junit.Test)

Example 7 with InteractiveTableTuple

use of main.database.InteractiveTableTuple in project Info-Evaluation by TechnionYP5777.

the class InteractiveAnalyzeParagraphTest method test3.

@Test
public void test3() {
    final Sentence sent = new Sentence("Vin Diesel was arrested for furious driving on August 14, 2002 in California");
    final InteractiveTableTuple itt = new AnalyzeParagragh(sent, "2002").InteractiveAnalyze();
    assertEquals("Vin Diesel", itt.getName());
    assertEquals("08/14/2002", itt.getDate());
    for (ReasonPair ¢ : itt.getReasons()) System.out.println(¢.getReason() + " with probability: " + ¢.getProbability());
}
Also used : AnalyzeParagragh(main.Analyze.AnalyzeParagragh) ReasonPair(main.database.ReasonPair) Sentence(edu.stanford.nlp.simple.Sentence) InteractiveTableTuple(main.database.InteractiveTableTuple) Test(org.junit.Test)

Example 8 with InteractiveTableTuple

use of main.database.InteractiveTableTuple in project Info-Evaluation by TechnionYP5777.

the class InteractiveAnalyzeParagraphTest method test1.

@Test
public void test1() {
    final Sentence sent = new Sentence("Justin Bieber was arrested for drunk driving in Georgia on February 22, 2015 .");
    final InteractiveTableTuple itt = new AnalyzeParagragh(sent, "2015").InteractiveAnalyze();
    assertEquals("Justin Bieber", itt.getName());
    assertEquals("02/22/2015", itt.getDate());
    for (ReasonPair ¢ : itt.getReasons()) System.out.println(¢.getReason() + " with probability: " + ¢.getProbability());
}
Also used : AnalyzeParagragh(main.Analyze.AnalyzeParagragh) ReasonPair(main.database.ReasonPair) Sentence(edu.stanford.nlp.simple.Sentence) InteractiveTableTuple(main.database.InteractiveTableTuple) Test(org.junit.Test)

Aggregations

InteractiveTableTuple (main.database.InteractiveTableTuple)8 Test (org.junit.Test)7 ReasonPair (main.database.ReasonPair)6 Sentence (edu.stanford.nlp.simple.Sentence)2 LinkedList (java.util.LinkedList)2 AnalyzeParagragh (main.Analyze.AnalyzeParagragh)2 SentencesAnnotation (edu.stanford.nlp.ling.CoreAnnotations.SentencesAnnotation)1 IndexedWord (edu.stanford.nlp.ling.IndexedWord)1 Annotation (edu.stanford.nlp.pipeline.Annotation)1 StanfordCoreNLP (edu.stanford.nlp.pipeline.StanfordCoreNLP)1 SemanticGraph (edu.stanford.nlp.semgraph.SemanticGraph)1 CollapsedDependenciesAnnotation (edu.stanford.nlp.semgraph.SemanticGraphCoreAnnotations.CollapsedDependenciesAnnotation)1 SemanticGraphEdge (edu.stanford.nlp.semgraph.SemanticGraphEdge)1 CoreMap (edu.stanford.nlp.util.CoreMap)1 Properties (java.util.Properties)1 AnalyzePage (main.Analyze.AnalyzePage)1