Package org.apache.stanbol.enhancer.servicesapi.impl

Examples of org.apache.stanbol.enhancer.servicesapi.impl.StringSource


    dbpslight = new DBPSpotlightAnnotateEnhancementEngine(new URL(SPL_URL),10);
  }
  @Before
  public void initTest() throws IOException {
    //create the contentItem for testing
    ci = ciFactory.createContentItem(new StringSource(TEST_TEXT));
    assertNotNull(ci);
    textContentPart = ContentItemHelper.getBlob(ci, Collections.singleton("text/plain"));
    assertNotNull(textContentPart);
    //add the language of the text
    ci.getMetadata().add(new TripleImpl(ci.getUri(), Properties.DC_LANGUAGE,
View Full Code Here


  }
 
  @Before
  public void initTest() throws IOException {
    //create the contentItem for testing
    ci = ciFactory.createContentItem(new StringSource(TEST_TEXT));
    assertNotNull(ci);
    textContentPart = ContentItemHelper.getBlob(ci, Collections.singleton("text/plain"));
    assertNotNull(textContentPart);
    //add the language of the text
    ci.getMetadata().add(new TripleImpl(ci.getUri(), Properties.DC_LANGUAGE,
View Full Code Here

  }

  @Before
  public void initTest() throws IOException {
    //create the contentItem for testing
    ci = ciFactory.createContentItem(new StringSource(TEST_TEXT));
    assertNotNull(ci);
    textContentPart = ContentItemHelper.getBlob(ci, Collections.singleton("text/plain"));
    assertNotNull(textContentPart);
    //add the language of the text
    ci.getMetadata().add(new TripleImpl(ci.getUri(), Properties.DC_LANGUAGE,
View Full Code Here

  }
 
  @Before
  public void initTest() throws IOException {
    //create the contentItem for testing
    ci = ciFactory.createContentItem(new StringSource(TEST_TEXT));
    assertNotNull(ci);
    textContentPart = ContentItemHelper.getBlob(ci, Collections.singleton("text/plain"));
    assertNotNull(textContentPart);
    //add the language of the text
    ci.getMetadata().add(new TripleImpl(ci.getUri(), Properties.DC_LANGUAGE,
View Full Code Here

        locationEnhancementEngine.deactivate(null);
    }

    public static ContentItem getContentItem(final String id,
            final String text) throws IOException {
      return ciFactory.createContentItem(new UriRef(id), new StringSource(text));
    }
View Full Code Here

        graph.add(new TripleImpl(uri, TYPE, OntologicalClasses.DBPEDIA_ORGANISATION));
        searcher.addEntity(new Entity(uri, graph));
       
        Value<PhraseTag> nounPhrase = Value.value(new PhraseTag("NP",LexicalCategory.Noun),1d);
        TEST_ANALYSED_TEXT = AnalysedTextFactory.getDefaultInstance().createAnalysedText(
                ciFactory.createBlob(new StringSource(TEST_TEXT)));
        TEST_ANALYSED_TEXT.addSentence(0, TEST_ANALYSED_TEXT.getEnd());
        //add some noun phrases
        TEST_ANALYSED_TEXT.addChunk(0, "Dr. Patrick Marshall".length()).addAnnotation(PHRASE_ANNOTATION, nounPhrase);
        TEST_ANALYSED_TEXT.addChunk(TEST_TEXT.indexOf("New Zealand"), TEST_TEXT.indexOf("New Zealand")+"New Zealand".length())
        .addAnnotation(PHRASE_ANNOTATION, nounPhrase);
View Full Code Here

    @AfterClass
    public static void shutdownServices() {
    }

    public static ContentItem getContentItem(final String id, final String text) throws IOException {
        return ciFactory.createContentItem(new UriRef(id),new StringSource(text));
    }
View Full Code Here

        linkerConfig.setRedirectProcessingMode(RedirectProcessingMode.FOLLOW);
        linkerConfig.setMinFoundTokens(2);//this is assumed by this test
        EntityLinkingEngine engine = new EntityLinkingEngine("dummy",
            searcher, new TextProcessingConfig(),
            linkerConfig, labelTokenizer);
        ContentItem ci = ciFactory.createContentItem(new StringSource(TEST_TEXT));
        //tells the engine that this is an English text
        ci.getMetadata().add(new TripleImpl(ci.getUri(), DC_LANGUAGE, new PlainLiteralImpl("en")));
        //and add the AnalysedText instance used for this test
        ci.addPart(AnalysedText.ANALYSED_TEXT_URI, TEST_ANALYSED_TEXT);
        //compute the enhancements
View Full Code Here

TOP

Related Classes of org.apache.stanbol.enhancer.servicesapi.impl.StringSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.