private void initEnv() { env = TokenSequencePattern.getNewEnv(); env.setDefaultTokensAnnotationKey(CoreAnnotations.NumerizedTokensAnnotation.class); // Do case insensitive matching env.setDefaultStringMatchFlags(Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); env.setDefaultStringPatternFlags(Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); try { Units.registerUnits(env, options.unitsFilename); } catch (IOException ex) { throw new RuntimeException("Error loading units from " + options.unitsFilename, ex); } try { UnitPrefix.registerPrefixes(env, options.prefixFilename); } catch (IOException ex) { throw new RuntimeException("Error loading prefixes from " + options.prefixFilename, ex); } env.bind("options", options); env.bind("numcomptype", CoreAnnotations.NumericCompositeTypeAnnotation.class); env.bind("numcompvalue", CoreAnnotations.NumericCompositeValueAnnotation.class); }
env.setDefaultTokensAnnotationKey(CoreAnnotations.NumerizedTokensAnnotation.class); env.setDefaultResultAnnotationKey(TimeExpression.Annotation.class); env.setDefaultNestedResultsAnnotationKey(TimeExpression.ChildrenAnnotation.class);
private void initEnv() { env = TokenSequencePattern.getNewEnv(); env.setDefaultTokensAnnotationKey(CoreAnnotations.NumerizedTokensAnnotation.class); // Do case insensitive matching env.setDefaultStringMatchFlags(Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); env.setDefaultStringPatternFlags(Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); try { Units.registerUnits(env, options.unitsFilename); } catch (IOException ex) { throw new RuntimeException("Error loading units from " + options.unitsFilename, ex); } try { UnitPrefix.registerPrefixes(env, options.prefixFilename); } catch (IOException ex) { throw new RuntimeException("Error loading prefixes from " + options.prefixFilename, ex); } env.bind("options", options); env.bind("numcomptype", CoreAnnotations.NumericCompositeTypeAnnotation.class); env.bind("numcompvalue", CoreAnnotations.NumericCompositeValueAnnotation.class); }
env.setDefaultTokensAnnotationKey(CoreAnnotations.NumerizedTokensAnnotation.class); env.setDefaultResultAnnotationKey(TimeExpression.Annotation.class); env.setDefaultNestedResultsAnnotationKey(TimeExpression.ChildrenAnnotation.class);
env.setDefaultTokensAnnotationKey(CoreAnnotations.NumerizedTokensAnnotation.class); env.setDefaultResultAnnotationKey(TimeExpression.Annotation.class); env.setDefaultNestedResultsAnnotationKey(TimeExpression.ChildrenAnnotation.class);