Examples of LanguageConfiguration


Examples of org.apache.stanbol.enhancer.nlp.utils.LanguageConfiguration

        //We can create the default configuration only here, as it depends on the
        //name of the solrIndex
        String defaultConfig = "*;"
                + IndexConfiguration.PARAM_FST + "=" + indexReference.getIndex() + ";"
                + IndexConfiguration.PARAM_FIELD + "=" + IndexConfiguration.DEFAULT_FIELD;
        fstConfig = new LanguageConfiguration(IndexConfiguration.FST_CONFIG, new String[]{defaultConfig});
        //now set the actual configuration parsed to the engine
        value = properties.get(IndexConfiguration.FST_CONFIG);
        if(value != null && !StringUtils.isBlank(value.toString())){
            fstConfig.setConfiguration(properties);
        } //else keep the default
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.utils.LanguageConfiguration

            solrIndexRef.getIndex());
        Assert.assertNotNull("Unable to get SolrCore '" + config.getIndexConfigurationName()
            + "' from SolrServer "+server, core);
        yard = new SolrYard(server,config,null);
        //setup the index configuration
        LanguageConfiguration langConf = new LanguageConfiguration("not.used",
            new String[]{"en;field=dbpedia-ont:surfaceForm;generate=true"});
        fstConfig = new IndexConfiguration(langConf, core, FieldEncodingEnum.SolrYard);
        fstConfig.setExecutorService(Executors.newFixedThreadPool(1));
        fstConfig.setTypeField("rdf:type");
        fstConfig.setRankingField("entityhub:entityRank");
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.utils.LanguageConfiguration

                @Override
                public Object addingService(ServiceReference reference) {
                    if(managerServicePid.equals(reference.getProperty(Constants.SERVICE_PID))){
                        return null; //do not track this manager!
                    }
                    LanguageConfiguration langConf = new LanguageConfiguration(SUPPORTED_LANUAGES, DEFAULT_LANG_CONF);
                    try {
                        langConf.setConfiguration(reference);
                    } catch (ConfigurationException e) {
                        log.error("Unable to track ServiceReference {} becuase of invalid LanguageConfiguration("
                            + SUPPORTED_LANUAGES+"="+reference.getProperty(SUPPORTED_LANUAGES)+")!",e);
                        return null;
                    }
                    Object service = bundleContext.getService(reference);
                    if(service != null){
                        ref2LangConfig.put(reference, langConf);
                        langTokenizers.clear();
                    }
                    return service;
                }


                @Override
                public void modifiedService(ServiceReference reference, Object service) {
                    if(managerServicePid.equals(reference.getProperty(Constants.SERVICE_PID))){
                        return; //ignore this service!
                    }
                    LanguageConfiguration langConf = new LanguageConfiguration(SUPPORTED_LANUAGES, DEFAULT_LANG_CONF);
                    try {
                        langConf.setConfiguration(reference);
                        ref2LangConfig.put(reference, langConf);
                        langTokenizers.clear();
                    } catch (ConfigurationException e) {
                        log.error("Unable to track ServiceReference {} becuase of invalid LanguageConfiguration("
                            + SUPPORTED_LANUAGES+"="+reference.getProperty(SUPPORTED_LANUAGES)+")!",e);
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.utils.LanguageConfiguration

   
    private List<ServiceReference> initTokenizers(String language) {
        List<ServiceReference> tokenizers = new ArrayList<ServiceReference>();
        if(labelTokenizerTracker.getServiceReferences() != null){
            for(ServiceReference ref : labelTokenizerTracker.getServiceReferences()){
                LanguageConfiguration langConf = ref2LangConfig.get(ref);
                if(langConf != null && langConf.isLanguage(language)){
                    tokenizers.add(ref);
                }
            }
        }
        if(tokenizers.size() > 1){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.