Package org.apache.ctakes.core.resource

Examples of org.apache.ctakes.core.resource.MaxentModelResource


   * Reads configuration parameters.
   *
   * @throws ResourceAccessException
   */
  private void configInit() throws ResourceAccessException {
    MaxentModelResource mmResrc = (MaxentModelResource) context
        .getResourceObject(MAXENT_MODEL_RESRC_KEY);
    // <code>SuffixMaxentModelResourceImpl</code> will log the name of the
    // resource at load() time
    // logger.info("Sentence detector resource: " +
    // mmResrc.getModel().toString());

    if (mmResrc == null) {
      // TODO Consider throwing an exception here
      logger.warn("Unable to locate resource with key="
          + MAXENT_MODEL_RESRC_KEY + ".");
    } else {
      EndOfSentenceScannerImpl eoss = new EndOfSentenceScannerImpl();
      char[] eosc = eoss.getEndOfSentenceCharacters();
      // SentenceDContextGenerator cg = new SentenceDContextGenerator();
      DefaultSDContextGenerator cg = new DefaultSDContextGenerator(eosc);
      sentenceDetector = new SentenceDetectorCtakes(mmResrc.getModel(), cg, eoss);
    }

    skipSegmentsSet = ParamUtil.getStringParameterValuesSet(
        PARAM_SEGMENTS_TO_SKIP, context);
  }
View Full Code Here

TOP

Related Classes of org.apache.ctakes.core.resource.MaxentModelResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.