Search in sources :

Example 26 with Sentence

use of edu.stanford.nlp.simple.Sentence in project Info-Evaluation by TechnionYP5777.

the class AnalyzeParagraphTest method test5.

@Test
public void test5() {
    final Sentence sent = new Sentence("Axl Rose was arrested after driving drunk in New Zeland on March 1.");
    final TableTuple tt = new AnalyzeParagragh(sent, "2015").Analyze();
    assertEquals("Axl Rose", tt.getName());
    assertEquals("driving drunk in New Zeland", tt.getReason());
    assertEquals("03/01/2015", tt.getDate());
}
Also used : TableTuple(main.database.TableTuple) AnalyzeParagragh(main.Analyze.AnalyzeParagragh) Sentence(edu.stanford.nlp.simple.Sentence) Test(org.junit.Test)

Example 27 with Sentence

use of edu.stanford.nlp.simple.Sentence in project Info-Evaluation by TechnionYP5777.

the class AnalyzeParagraphTest method test6.

@Test
public void test6() {
    final Sentence sent = new Sentence("Joe Francis was arrested for attacking at a Nightclub on May 16.");
    final TableTuple tt = new AnalyzeParagragh(sent, "2015").Analyze();
    assertEquals("Joe Francis", tt.getName());
    assertEquals("attacking at Nightclub", tt.getReason());
    assertEquals("05/16/2015", tt.getDate());
}
Also used : TableTuple(main.database.TableTuple) AnalyzeParagragh(main.Analyze.AnalyzeParagragh) Sentence(edu.stanford.nlp.simple.Sentence) Test(org.junit.Test)

Example 28 with Sentence

use of edu.stanford.nlp.simple.Sentence in project Info-Evaluation by TechnionYP5777.

the class App method main.

public static void main(final String[] args) {
    System.out.println("Hello World!");
    final Sentence sent = new Sentence("Justin Bieber is in the sky with diamonds.");
    System.out.println(Arrays.toString(sent.nerTags().toArray()));
    // NNP
    final String firstPOSTag = sent.posTag(0);
    System.out.println(sent.word(0));
    System.out.println(firstPOSTag);
}
Also used : Sentence(edu.stanford.nlp.simple.Sentence)

Example 29 with Sentence

use of edu.stanford.nlp.simple.Sentence in project Info-Evaluation by TechnionYP5777.

the class AnalyzeParagraphTest method test8.

@Test
public void test8() {
    final Sentence sent = new Sentence("David Cassidy was arrested for driving under the influence on Jan 10 after he allegedly took a breathalyzer test and was found to be over twice the legal limit.\n");
    final TableTuple tt = new AnalyzeParagragh(sent, "2015").Analyze();
    assertEquals("David Cassidy", tt.getName());
    assertEquals("driving under influence", tt.getReason());
    assertEquals("01/10/2015", tt.getDate());
}
Also used : TableTuple(main.database.TableTuple) AnalyzeParagragh(main.Analyze.AnalyzeParagragh) Sentence(edu.stanford.nlp.simple.Sentence) Test(org.junit.Test)

Example 30 with Sentence

use of edu.stanford.nlp.simple.Sentence in project Info-Evaluation by TechnionYP5777.

the class AnalyzeParagraphTest method test11.

@Test
public void test11() {
    final Sentence sent = new Sentence("Juan Diego Fernandez was arrested for cheating by Axl Rose on Jan 25 1992 .");
    final TableTuple tt = new AnalyzeParagragh(sent, "1992").Analyze();
    assertEquals("Juan Diego Fernandez", tt.getName());
    assertEquals("01/25/1992", tt.getDate());
    assertEquals("cheating", tt.getReason());
}
Also used : TableTuple(main.database.TableTuple) AnalyzeParagragh(main.Analyze.AnalyzeParagragh) Sentence(edu.stanford.nlp.simple.Sentence) Test(org.junit.Test)

Aggregations

Sentence (edu.stanford.nlp.simple.Sentence)31 Test (org.junit.Test)18 AnalyzeParagragh (main.Analyze.AnalyzeParagragh)16 TableTuple (main.database.TableTuple)12 CoreLabel (edu.stanford.nlp.ling.CoreLabel)7 CoreLabelTokenFactory (edu.stanford.nlp.process.CoreLabelTokenFactory)4 StringReader (java.io.StringReader)4 Span (edu.stanford.nlp.ie.machinereading.structure.Span)3 CoreMap (edu.stanford.nlp.util.CoreMap)3 SentenceField (edu.stanford.nlp.util.TSVSentenceIterator.SentenceField)3 ScoredPassage (io.anserini.qa.passage.ScoredPassage)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 IndexUtils (io.anserini.index.IndexUtils)2 IdfPassageScorer (io.anserini.qa.passage.IdfPassageScorer)2 InteractiveTableTuple (main.database.InteractiveTableTuple)2 ReasonPair (main.database.ReasonPair)2 edu.stanford.nlp.classify (edu.stanford.nlp.classify)1 NERTag (edu.stanford.nlp.ie.KBPRelationExtractor.NERTag)1 IOUtils (edu.stanford.nlp.io.IOUtils)1