Package org.apache.stanbol.commons.opennlp.TextAnalyzer

Examples of org.apache.stanbol.commons.opennlp.TextAnalyzer.TextAnalyzerConfig


     * languages based on the value of the
     *
     * @param configuration the OSGI component configuration
     */
    protected final void activateTextAnalyzerConfig(Dictionary<String,Object> configuration) throws ConfigurationException {
        nlpConfig = new TextAnalyzerConfig();
        Object value;
        value = configuration.get(PROCESSED_LANGUAGES);
        if(value == null){
            this.languages = DEFAULT_LANGUAGES;
        } else if (value.toString().trim().isEmpty()){
View Full Code Here


    }

    @Test
    public void testTaxonomyLinker() throws Exception{
        OpenNlpAnalysedContentFactory acf = OpenNlpAnalysedContentFactory.getInstance(openNLP,
            new TextAnalyzerConfig());
        EntityLinkerConfig config = new EntityLinkerConfig();
        config.setRedirectProcessingMode(RedirectProcessingMode.FOLLOW);
        EntityLinker linker = new EntityLinker(
            acf.create(TEST_TEXT,"en"), searcher, config);
        linker.process();
View Full Code Here

        assertTrue(analyzer.getConfig().isPosTypeChunkerForced());
        checkSingleSentence(analysed,SINGLE_SENTENCE_TOKENS,true,true);
    }
    @Test
    public void testSingleSentenceChunkerConfig(){
        TextAnalyzerConfig config = new TextAnalyzerConfig();
        config.forcePosTypeChunker(false);
        TextAnalyzer analyzer = new TextAnalyzer(openNLP,LANGUAGE,config);
        AnalysedText analysed = analyzer.analyseSentence(SINGLE_SENTENCE);
        assertNotNull(analysed);
        //check the default config
        assertFalse(analyzer.getConfig().isSimpleTokenizerForced());
View Full Code Here

        assertFalse(analyzer.getConfig().isPosTypeChunkerForced());
        checkSingleSentence(analysed,SINGLE_SENTENCE_TOKENS,true,true);
    }
    @Test
    public void testSingleSentenceNoChunkerConfig(){
        TextAnalyzerConfig config = new TextAnalyzerConfig();
        config.enableChunker(false);
        TextAnalyzer analyzer = new TextAnalyzer(openNLP,LANGUAGE,config);
        AnalysedText analysed = analyzer.analyseSentence(SINGLE_SENTENCE);
        assertNotNull(analysed);
        //check the default config
        assertFalse(analyzer.getConfig().isSimpleTokenizerForced());
View Full Code Here

        assertTrue(analyzer.getConfig().isPosTypeChunkerForced());
        checkSingleSentence(analysed,SINGLE_SENTENCE_TOKENS,true,false);
    }
    @Test
    public void testSingleSentenceNoChunkerNoPosConfig(){
        TextAnalyzerConfig config = new TextAnalyzerConfig();
        config.enablePosTagger(false);
        config.enableChunker(true);//must be ignored for Chunks if no Pos
        TextAnalyzer analyzer = new TextAnalyzer(openNLP,LANGUAGE,config);
        AnalysedText analysed = analyzer.analyseSentence(SINGLE_SENTENCE);
        assertNotNull(analysed);
        //check the default config
        assertFalse(analyzer.getConfig().isSimpleTokenizerForced());
View Full Code Here

TOP

Related Classes of org.apache.stanbol.commons.opennlp.TextAnalyzer.TextAnalyzerConfig

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.