module OpenNLP::Bindings # Require configuration. require 'open-nlp/config' # ############################ # # BindIt Configuration Options # # ############################ # require 'bind-it' extend BindIt::Binding # Load the JVM with a minimum heap size of 512MB, # and a maximum heap size of 1024MB. self.jvm_args = ['-Xms512M', '-Xmx1024M'] # Turn logging off by default. self.log_file = nil # Default JARs to load. self.default_jars = [ 'jwnl-1.3.3.jar', 'opennlp-tools-1.5.2-incubating.jar', 'opennlp-maxent-3.0.2-incubating.jar', 'opennlp-uima-1.5.2-incubating.jar' ] # Default namespace. self.default_namespace = 'opennlp.tools' # Default classes. self.default_classes = [ # OpenNLP classes. ['AbstractBottomUpParser', 'opennlp.tools.parser'], ['DocumentCategorizerME', 'opennlp.tools.doccat'], ['ChunkerME', 'opennlp.tools.chunker'], ['DictionaryDetokenizer', 'opennlp.tools.tokenize'], ['NameFinderME', 'opennlp.tools.namefind'], ['Parser', 'opennlp.tools.parser.chunking'], ['Parse', 'opennlp.tools.parser'], ['ParserFactory', 'opennlp.tools.parser'], ['POSTaggerME', 'opennlp.tools.postag'], ['SentenceDetectorME', 'opennlp.tools.sentdetect'], ['SimpleTokenizer', 'opennlp.tools.tokenize'], ['Span', 'opennlp.tools.util'], ['TokenizerME', 'opennlp.tools.tokenize'], # Generic Java classes. ['FileInputStream', 'java.io'], ['String', 'java.lang'], ['ArrayList', 'java.util'] ] # Add in Rjb workarounds. unless RUBY_PLATFORM =~ /java/ self.default_jars << 'utils.jar' self.default_classes << ['Utils', ''] end # ############################ # # OpenNLP bindings proper # # ############################ # class <