Package org.apache.stanbol.enhancer.engines.entitylinking.config

Examples of org.apache.stanbol.enhancer.engines.entitylinking.config.TextProcessingConfig


    @Test
    public void testFstLinkingWithProperNouns() throws Exception {
        Dictionary<String,Object> dict = new Hashtable<String,Object>();
        dict.put(PROCESSED_LANGUAGES, Arrays.asList("en;lmmtip;uc=LINK;prob=0.75;pprob=0.75"));
        dict.put(PROCESS_ONLY_PROPER_NOUNS_STATE, true);
        TextProcessingConfig tpc = TextProcessingConfig.createInstance(dict);
        EntityLinkerConfig elc = new EntityLinkerConfig();
        elc.setMinFoundTokens(2);//this is assumed by this test
        elc.setRedirectProcessingMode(RedirectProcessingMode.FOLLOW);
        FstLinkingEngine engine = new FstLinkingEngine("proper-noun-linking",
            fstConfig, tpc, elc);
View Full Code Here


    @Test
    public void testFstLinkingWithNouns() throws Exception {
        Dictionary<String,Object> dict = new Hashtable<String,Object>();
        dict.put(PROCESSED_LANGUAGES, Arrays.asList("en;lmmtip;uc=LINK;prob=0.75;pprob=0.75"));
        dict.put(PROCESS_ONLY_PROPER_NOUNS_STATE, false);
        TextProcessingConfig tpc = TextProcessingConfig.createInstance(dict);
        EntityLinkerConfig elc = new EntityLinkerConfig();
        elc.setMinFoundTokens(2);//this is assumed by this test
        elc.setRedirectProcessingMode(RedirectProcessingMode.FOLLOW);
        FstLinkingEngine engine = new FstLinkingEngine("proper-noun-linking",
            fstConfig, tpc, elc);
View Full Code Here

    public void testEngine() throws IOException, EngineException {
        EntityLinkerConfig linkerConfig = new EntityLinkerConfig();
        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
View Full Code Here

    @SuppressWarnings("unchecked")
    protected void activate(ComponentContext ctx) throws ConfigurationException {
        Dictionary<String,Object> properties = ctx.getProperties();
        bundleContext = ctx.getBundleContext();
        EntityLinkerConfig linkerConfig = EntityLinkerConfig.createInstance(properties,prefixService);
        TextProcessingConfig textProcessingConfig = TextProcessingConfig.createInstance(properties);
        Object value = properties.get(SITE_ID);
        //init the EntitySource
        if (value == null) {
            throw new ConfigurationException(SITE_ID,
                    "The ID of the Referenced Site is a required Parameter and MUST NOT be NULL!");
View Full Code Here

    @SuppressWarnings("unchecked")
    protected void activate(ComponentContext ctx) throws ConfigurationException {
        Dictionary<String,Object> properties = ctx.getProperties();
        bundleContext = ctx.getBundleContext();
        EntityLinkerConfig linkerConfig = EntityLinkerConfig.createInstance(properties,prefixService);
        TextProcessingConfig textProcessingConfig = TextProcessingConfig.createInstance(properties);
        Object value = properties.get(SITE_ID);
        //init the EntitySource
        if (value == null) {
            throw new ConfigurationException(SITE_ID,
                    "The ID of the Referenced Site is a required Parameter and MUST NOT be NULL!");
View Full Code Here

    public void testEngine() throws IOException, EngineException {
        EntityLinkerConfig linkerConfig = new EntityLinkerConfig();
        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
View Full Code Here

TOP

Related Classes of org.apache.stanbol.enhancer.engines.entitylinking.config.TextProcessingConfig

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.