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

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


        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

     */
    protected KeywordLinkingEngine(OpenNLP openNLP,EntitySearcher entitySearcher,
                                   TextAnalyzerConfig nlpConfig,EntityLinkerConfig linkingConfig){
        this.openNLP = openNLP;
        this.linkerConfig = linkingConfig != null ? linkingConfig : new EntityLinkerConfig();
        this.nlpConfig = nlpConfig != null ? nlpConfig : new TextAnalyzerConfig();
        this.analysedContentFactory = OpenNlpAnalysedContentFactory.getInstance(openNLP,nlpConfig);
        this.entitySearcher = entitySearcher;
    }
View Full Code Here

     * 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

     * @throws Exception
     */
    @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

     */
    @Test
    public void testEngine() throws IOException, EngineException {
        EntityLinkerConfig linkerConfig = new EntityLinkerConfig();
        linkerConfig.setRedirectProcessingMode(RedirectProcessingMode.FOLLOW);
        KeywordLinkingEngine engine = KeywordLinkingEngine.createInstance(openNLP, searcher, new TextAnalyzerConfig(),
            linkerConfig);
        engine.referencedSiteName = TEST_REFERENCED_SITE_NAME;
        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")));
View Full Code Here

     */
    protected KeywordLinkingEngine(OpenNLP openNLP,EntitySearcher entitySearcher,
                                   TextAnalyzerConfig nlpConfig,EntityLinkerConfig linkingConfig){
        this.openNLP = openNLP;
        this.linkerConfig = linkingConfig != null ? linkingConfig : new EntityLinkerConfig();
        this.nlpConfig = nlpConfig != null ? nlpConfig : new TextAnalyzerConfig();
        this.analysedContentFactory = OpenNlpAnalysedContentFactory.getInstance(openNLP,nlpConfig);
        this.entitySearcher = entitySearcher;
    }
View Full Code Here

     * 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

     */
    protected KeywordLinkingEngine(OpenNLP openNLP,EntitySearcher entitySearcher,
                                   TextAnalyzerConfig nlpConfig,EntityLinkerConfig linkingConfig){
        this.openNLP = openNLP;
        this.linkerConfig = linkingConfig != null ? linkingConfig : new EntityLinkerConfig();
        this.nlpConfig = nlpConfig != null ? nlpConfig : new TextAnalyzerConfig();
        this.analysedContentFactory = OpenNlpAnalysedContentFactory.getInstance(openNLP,nlpConfig);
        this.entitySearcher = entitySearcher;
    }
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.