tree: 45d08d137672745e637edf7856eacc01d6257bea [path history] [tgz]
  1. src/
  2. pom.xml
  3. README.md
commons/solr/extras/paoding/README.md

Apache Stanbol Commons Solr extension for paoding-analysis

This module provides the paoding-analysis analyzer for Chinese as bundle extending the default Apache Stanbol Commons Solr core module.

paoding-analysis version

This modules includes an fork from revision 154 of the the paoding-analysis projects svn repository.

The last commit to this projects repository was in Nov 15, 2010. The project is under the Apache License 2.0.

Changes to the original paoding source

This provides an overview on all changes made to the paoding source code (anything in the net.paoding.* packages)

  • The Logging framework was changed to SLF4J as this is the one preferable used by Stanbol
  • Resources are now loaded via both the ContextClassloader and (if not present) the Classloader used to load the padding classes. Originally the Classloader of the paoding classes was only considered if the ContextClassloader was null
  • Environment properties can now also be loaded from Java system properties (e.g. parsed via the -D argument to the JVM). System properties are only considered if no Environment property is defined.

Dictionary

The dictionary is included in the module in an ZIP archive. The org.apache.stanbol.commons.solr.extras.paoding.Activator class can be used to initialize the dictionary. When using this module in OSGI this will be done automatically by the Bundle Activator. Outside of OSGI (e.g. for unit test) this needs to be done manually by calling:

:::java
File paodingDict; //the directory for the dict
if(!paodingDict.isDirectory()){
    Activator.initPaodingDictionary(paodingDict, 
        getClass().getClassLoader().getResourceAsStream(
            Activator.DICT_ARCHIVE));
}
Activator.initPaodingDictHomeProperty(paodingDict);

All initialization methods supported by paoding are still supported. In addition the dictionary location can now also be parsed as Java system property (e.g. by adding ‘-DPAODING_DIC_HOME={path}’ when starting the JVM).

This module also includes an default ‘paoding-analysis.properties’ file that sets the default dictionary path to ‘.’ (the working directory). Users can use their own dictionary file if they place it in the classpath in front of this module.