/** * get a ResourceManager object with the default key/value pairs for this configurator default * SRL_TYPE is Verb. * * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getDefaultConfig() { Property[] properties = {USE_JSON, USE_LAZY_INITIALIZATION, USE_SRL_INTERNAL_PREPROCESSOR, SPLIT_ON_DASH, USE_SENTENCE_PIPELINE}; return (new AnnotatorServiceConfigurator().getConfig(new ResourceManager( generateProperties(properties)))); }
/** * create an AnnotatorService with components specified by the ResourceManager (to override * defaults in {@link ExternalToolsConfigurator} * * @param rm non-default config options * @return AnnotatorService with specified NLP components * @throws IOException * @throws AnnotatorException */ public static BasicAnnotatorService buildPipeline(ResourceManager rm, Map<String, Annotator> annotators) throws IOException, AnnotatorException { // Merges default configuration with the user-specified overrides. ResourceManager fullRm = (new ExternalToolsConfigurator()).getConfig(rm); Boolean splitOnDash = fullRm.getBoolean(ExternalToolsConfigurator.SPLIT_ON_DASH); boolean isSentencePipeline = fullRm.getBoolean(ExternalToolsConfigurator.USE_SENTENCE_PIPELINE.key); TextAnnotationBuilder taBldr = new TokenizerTextAnnotationBuilder(new StatefulTokenizer(splitOnDash, false)); return new BasicAnnotatorService(taBldr, annotators, fullRm); } }
/** * create an AnnotatorService with components specified by the ResourceManager (to override * defaults in {@link ExternalToolsConfigurator} * * @param rm non-default config options * @return AnnotatorService with specified NLP components * @throws IOException * @throws AnnotatorException */ public static BasicAnnotatorService buildPipeline(ResourceManager rm, Map<String, Annotator> annotators) throws IOException, AnnotatorException { // Merges default configuration with the user-specified overrides. ResourceManager fullRm = (new ExternalToolsConfigurator()).getConfig(rm); Boolean splitOnDash = fullRm.getBoolean(ExternalToolsConfigurator.SPLIT_ON_DASH); boolean isSentencePipeline = fullRm.getBoolean(ExternalToolsConfigurator.USE_SENTENCE_PIPELINE.key); TextAnnotationBuilder taBldr = new TokenizerTextAnnotationBuilder(new StatefulTokenizer(splitOnDash, false)); return new BasicAnnotatorService(taBldr, annotators, fullRm); } }
/** * get a ResourceManager object with the default key/value pairs for this configurator default * SRL_TYPE is Verb. * * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getDefaultConfig() { Property[] properties = {USE_JSON, USE_LAZY_INITIALIZATION, USE_SRL_INTERNAL_PREPROCESSOR, SPLIT_ON_DASH, USE_SENTENCE_PIPELINE}; return (new AnnotatorServiceConfigurator().getConfig(new ResourceManager( generateProperties(properties)))); }