Package org.apache.stanbol.enhancer.engines.langid

Examples of org.apache.stanbol.enhancer.engines.langid.LangIdEnhancementEngine


     * @throws IOException
     * @throws ConfigurationException
     */
    @Test
    public void testEngine() throws EngineException, IOException, ConfigurationException {
        LangIdEnhancementEngine langIdEngine = new LangIdEnhancementEngine();
        ComponentContext context =  new MockComponentContext();
        context.getProperties().put(EnhancementEngine.PROPERTY_NAME, "langid");
        langIdEngine.activate(context);
        ContentItem ci = ciFactory.createContentItem(new StringSource(text));
        langIdEngine.computeEnhancements(ci);
        HashMap<UriRef,Resource> expectedValues = new HashMap<UriRef,Resource>();
        expectedValues.put(Properties.ENHANCER_EXTRACTED_FROM, ci.getUri());
        expectedValues.put(Properties.DC_CREATOR, LiteralFactory.getInstance().createTypedLiteral(
            langIdEngine.getClass().getName()));
        int textAnnotationCount = validateAllTextAnnotations(ci.getMetadata(), text, expectedValues);
        assertEquals("A single TextAnnotation is expected", 1,textAnnotationCount);
        //even through this tests do not validate service quality but rather
        //the correct integration of the CELI service as EnhancementEngine
        //we expect the "en" is detected for the parsed text
View Full Code Here

TOP

Related Classes of org.apache.stanbol.enhancer.engines.langid.LangIdEnhancementEngine

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.