Search in sources :

Example 11 with WikiParsing

use of infoeval.main.WikiData.WikiParsing in project Info-Evaluation by TechnionYP5777.

the class AnalyzeParagraph method LoadIEClassifiers.

public void LoadIEClassifiers() throws IOException {
    // Load openIE classifiers
    WikiParsing wiki = (new WikiParsing("https://en.wikipedia.org/wiki/Adele"));
    wiki.Parse("won");
    setParagraphsAwards(wiki.getParagraphs());
    clearAwardsInformation();
    AwardsQuery();
    clearAwardsInformation();
}
Also used : WikiParsing(infoeval.main.WikiData.WikiParsing)

Example 12 with WikiParsing

use of infoeval.main.WikiData.WikiParsing in project Info-Evaluation by TechnionYP5777.

the class AnalyzeParagraphTest method Test1.

@Test
public void Test1() throws IOException {
    WikiParsing wiki = (new WikiParsing("https://en.wikipedia.org/wiki/The_Weeknd"));
    wiki.Parse("arrested");
    AnalyzeParagraph analyze = new AnalyzeParagraph();
    analyze.setParagraphsArrests(wiki.getParagraphs());
    analyze.AnalyzeArrestsQuery();
    assert (!analyze.getArrestsInformation().isEmpty());
}
Also used : WikiParsing(infoeval.main.WikiData.WikiParsing) AnalyzeParagraph(infoeval.main.Analysis.AnalyzeParagraph) Test(org.junit.Test)

Example 13 with WikiParsing

use of infoeval.main.WikiData.WikiParsing in project Info-Evaluation by TechnionYP5777.

the class AnalyzeParagraphTest method Test2.

// This test is for the new method of awards query.(see issue #224)
@Test
public void Test2() throws IOException {
    WikiParsing wiki = (new WikiParsing("https://en.wikipedia.org/wiki/Adele"));
    wiki.Parse("won");
    AnalyzeParagraph analyze = new AnalyzeParagraph();
    analyze.setParagraphsAwards(wiki.getParagraphs());
    analyze.AwardsQuery();
    LinkedList<String> info = analyze.getAwardsInformation();
    for (final String ¢ : info) // System.out.println(¢);
    assert (info.contains(" At the 51st Grammy Awards in 2009, Adele received the awards for Best New Artist and Best Female Pop Vocal Performance"));
}
Also used : WikiParsing(infoeval.main.WikiData.WikiParsing) AnalyzeParagraph(infoeval.main.Analysis.AnalyzeParagraph) Test(org.junit.Test)

Example 14 with WikiParsing

use of infoeval.main.WikiData.WikiParsing in project Info-Evaluation by TechnionYP5777.

the class WikiParsingTest method test4.

@Test
public void test4() throws IOException {
    WikiParsing wp = new WikiParsing("https://en.wikipedia.org/wiki/Michael_Jackson");
    wp.Parse("refer");
    assert !wp.isConflictedName();
}
Also used : WikiParsing(infoeval.main.WikiData.WikiParsing) Test(org.junit.Test)

Example 15 with WikiParsing

use of infoeval.main.WikiData.WikiParsing in project Info-Evaluation by TechnionYP5777.

the class WikiParsingTest method test8.

@Test
public void test8() throws IOException {
    WikiParsing wp = new WikiParsing("https://en.wikipedia.org/wiki/Slash");
    wp.Parse("married");
    wp.CheckAmbiguities();
    assert wp.getNames().size() == 28;
}
Also used : WikiParsing(infoeval.main.WikiData.WikiParsing) Test(org.junit.Test)

Aggregations

WikiParsing (infoeval.main.WikiData.WikiParsing)18 Test (org.junit.Test)12 IOException (java.io.IOException)4 AnalyzeParagraph (infoeval.main.Analysis.AnalyzeParagraph)3 CrossOrigin (org.springframework.web.bind.annotation.CrossOrigin)3 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3 ArrayList (java.util.ArrayList)2 LemmaAnnotation (edu.stanford.nlp.ling.CoreAnnotations.LemmaAnnotation)1 SentencesAnnotation (edu.stanford.nlp.ling.CoreAnnotations.SentencesAnnotation)1 TokensAnnotation (edu.stanford.nlp.ling.CoreAnnotations.TokensAnnotation)1 CoreLabel (edu.stanford.nlp.ling.CoreLabel)1 Annotation (edu.stanford.nlp.pipeline.Annotation)1 CollapsedDependenciesAnnotation (edu.stanford.nlp.semgraph.SemanticGraphCoreAnnotations.CollapsedDependenciesAnnotation)1 CoreMap (edu.stanford.nlp.util.CoreMap)1 AwardsQuery (infoeval.main.Analysis.AwardsQuery)1 LinkedList (java.util.LinkedList)1 Element (org.jsoup.nodes.Element)1