/** * 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); } }