<commit_before>package org.cleartk.util.ae;

import java.io.InputStream;
import java.net.URI;

import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.cas.impl.XCASDeserializer;
import org.apache.uima.cas.impl.XCASSerializer;
import org.apache.uima.cas.impl.XmiCasDeserializer;
import org.apache.uima.cas.impl.XmiCasSerializer;
import org.apache.uima.jcas.JCas;
import org.cleartk.util.ViewURIUtil;
import org.uimafit.component.JCasAnnotator_ImplBase;
import org.uimafit.descriptor.ConfigurationParameter;
import org.uimafit.factory.ConfigurationParameterFactory;

/**
 * <br>
 * Copyright (c) 2012, Regents of the University of Colorado <br>
 * All rights reserved.
 * 
 * Reads contents of URI in URIView and deserializes it into the CAS.
 * 
 * @see XmiCasSerializer
 * @see XCASSerializer
 * 
 * @author <NAME>
 * 
 */
public class UriToXmiCasAnnotator extends JCasAnnotator_ImplBase {

  public static enum XmlScheme {
    XMI, XCAS
  }

  public static final String PARAM_XML_SCHEME = ConfigurationParameterFactory.createConfigurationParameterName(
      UriToXmiCasAnnotator.class,
      "xmlScheme");
<commit_msg>Added static convenience methods for getting descriptors of this AnalysisEngine.<commit_after>package org.cleartk.util.ae;

import java.io.InputStream;
import java.net.URI;

import org.apache.uima.analysis_engine.AnalysisEngineDescription;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.cas.CAS;
import org.apache.uima.cas.impl.XCASDeserializer;
import org.apache.uima.cas.impl.XCASSerializer;
import org.apache.uima.cas.impl.XmiCasDeserializer;
import org.apache.uima.cas.impl.XmiCasSerializer;
import org.apache.uima.jcas.JCas;
import org.apache.uima.resource.ResourceInitializationException;
import org.cleartk.util.ViewURIUtil;
import org.uimafit.component.JCasAnnotator_ImplBase;
import org.uimafit.component.ViewCreatorAnnotator;
import org.uimafit.descriptor.ConfigurationParameter;
import org.uimafit.factory.AggregateBuilder;
import org.uimafit.factory.AnalysisEngineFactory;
import org.uimafit.factory.ConfigurationParameterFactory;

/**
 * <br>
 * Copyright (c) 2012, Regents of the University of Colorado <br>
 * All rights reserved.
 * 
 * Reads contents of URI in URIView and deserializes it into the CAS.
 * 
 * @see XmiCasSerializer
 * @see XCASSerializer
 * 
 * @author <NAME>
 * 
 */
public class UriToXmiCasAnnotator extends JCasAnnotator_ImplBase {

  public static AnalysisEngineDescription getDescription() throws ResourceInitializationException {
    return AnalysisEngineFactory.createPrimitiveDescription(UriToXmiCasAnnotator.class);
  }

  /**
   * Use this aggregate description if UriToDocumentTextAnnotator will be writing to a mapped view.
   * 
   * @param targetViewName
   * @return
   * @throws ResourceInitializationException
   */
  public static AnalysisEngineDescription getCreateViewAggregateDescription(String targetViewName)
      throws ResourceInitializationException {
    AggregateBuilder builder = new AggregateBuilder();
    builder.add(AnalysisEngineFactory.createPrimitiveDescription(
        ViewCreatorAnnotator.class,
        ViewCreatorAnnotator.PARAM_VIEW_NAME,
        targetViewName));
    builder.add(UriToXmiCasAnnotator.getDescription(), CAS.NAME_DEFAULT_SOFA, targetViewName);
    return builder.createAggregateDescription();
  }

  public static enum XmlScheme {
    XMI, XCAS
  }

  public static final String PARAM_XML_SCHEME = ConfigurationParameterFactory.createConfigurationParameterName(
      UriToXmiCasAnnotator.class,
      "xmlScheme");

{'fraction_non_alphanumeric': 0.08188105117565699, 'fraction_numerical': 0.0022130013831258644, 'mean_word_length': 5.277777777777778, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '420095', 'n_tokens_mistral': 1142, 'n_tokens_neox': 1081, 'n_words': 221}