/** * constructor that uses AnnotatorServiceConfigurator default configuration * * @param textAnnotationBuilder object that will build basic TextAnnotation objects * @param viewProviders annotators that will populate views in new TextAnnotation objects * @throws AnnotatorException */ public BasicAnnotatorService(TextAnnotationBuilder textAnnotationBuilder, Map<String, Annotator> viewProviders) throws AnnotatorException { this(textAnnotationBuilder, viewProviders, (new AnnotatorServiceConfigurator()) .getDefaultConfig()); }
/** * constructor that uses AnnotatorServiceConfigurator default configuration * * @param textAnnotationBuilder object that will build basic TextAnnotation objects * @param viewProviders annotators that will populate views in new TextAnnotation objects * @throws AnnotatorException */ public BasicAnnotatorService(TextAnnotationBuilder textAnnotationBuilder, Map<String, Annotator> viewProviders) throws AnnotatorException { this(textAnnotationBuilder, viewProviders, (new AnnotatorServiceConfigurator()) .getDefaultConfig()); }
public Preprocessor(ResourceManager rm) { ResourceManager fullRm = Configurator.mergeProperties(new AnnotatorServiceConfigurator().getDefaultConfig(), rm); try { TextAnnotationBuilder taBldr = new TokenizerTextAnnotationBuilder(new StatefulTokenizer(true, false)); Map<String, Annotator> annotators = new HashMap<>(); annotators.put(ViewNames.POS, new POSAnnotator()); annotators.put(ViewNames.LEMMA, new IllinoisLemmatizer()); annotators.put(ViewNames.SHALLOW_PARSE, new ChunkerAnnotator()); annotators.put(ViewNames.DEPENDENCY, new DepAnnotator()); annotator = new BasicAnnotatorService(taBldr, annotators, fullRm); } catch (Exception e) { logger.error("Unable to create preprocessor. \n{}", e.getMessage()); } }
public Preprocessor(ResourceManager rm) { ResourceManager fullRm = Configurator.mergeProperties(new AnnotatorServiceConfigurator().getDefaultConfig(), rm); try { TextAnnotationBuilder taBldr = new TokenizerTextAnnotationBuilder(new StatefulTokenizer(true, false)); Map<String, Annotator> annotators = new HashMap<>(); annotators.put(ViewNames.POS, new POSAnnotator()); annotators.put(ViewNames.LEMMA, new IllinoisLemmatizer()); annotators.put(ViewNames.SHALLOW_PARSE, new ChunkerAnnotator()); annotators.put(ViewNames.DEPENDENCY, new DepAnnotator()); annotator = new BasicAnnotatorService(taBldr, annotators, fullRm); } catch (Exception e) { logger.error("Unable to create preprocessor. \n{}", e.getMessage()); } }