<commit_before>package edu.ucdenver.ccp.nlp.ext.uima.shims.document.impl;

import org.apache.uima.jcas.JCas;

import edu.ucdenver.ccp.common.file.CharacterEncoding;
import edu.ucdenver.ccp.nlp.core.uima.annotation.CCPDocumentInformation;
import edu.ucdenver.ccp.nlp.core.uima.util.UIMA_Util;
import edu.ucdenver.ccp.nlp.ext.uima.shims.document.DocumentMetaDataExtractor;

/**
 * An implementation of {@link DocumentMetaDataExtractor} used to work with the CCP type system
 * 
 * @author bill
 * 
 */
public class CcpDocumentMetaDataExtractor implements DocumentMetaDataExtractor {

	/**
	 * @see edu.ucdenver.ccp.nlp.ext.uima.shims.document.shim.document.uchsc.ccp.uima.shim.DocumentMetaDataExtractor#extractDocumentEncoding(org.apache.uima.jcas.JCas)
	 */
	@Override
	public String extractDocumentEncoding(JCas jCas) {
//		return CharacterEncoding.UTF_8.getCharacterSetName();
		return UIMA_Util.getDocumentEncoding(jCas).getCharacterSetName();
	}

	/**
	 * @see edu.ucdenver.ccp.nlp.ext.uima.shims.document.shim.document.uchsc.ccp.uima.shim.DocumentMetaDataExtractor#extractDocumentId(org.apache.uima.jcas.JCas)<commit_msg>Refactored to account for DocumentMetaDataExtractor to DocumentMetadataHandler name change<commit_after>package edu.ucdenver.ccp.nlp.ext.uima.shims.document.impl;

import org.apache.uima.jcas.JCas;

import edu.ucdenver.ccp.common.file.CharacterEncoding;
import edu.ucdenver.ccp.nlp.core.uima.annotation.CCPDocumentInformation;
import edu.ucdenver.ccp.nlp.core.uima.util.UIMA_Util;
import edu.ucdenver.ccp.uima.shims.document.DocumentMetadataHandler;

/**
 * An implementation of {@link DocumentMetaDataExtractor} used to work with the CCP type system
 * 
 * @author bill
 * 
 */
public class CcpDocumentMetaDataExtractor implements DocumentMetadataHandler {

	/**
	 * @see edu.ucdenver.ccp.nlp.ext.uima.shims.document.shim.document.uchsc.ccp.uima.shim.DocumentMetaDataExtractor#extractDocumentEncoding(org.apache.uima.jcas.JCas)
	 */
	@Override
	public String extractDocumentEncoding(JCas jCas) {
//		return CharacterEncoding.UTF_8.getCharacterSetName();
		return UIMA_Util.getDocumentEncoding(jCas).getCharacterSetName();
	}

	/**
	 * @see edu.ucdenver.ccp.nlp.ext.uima.shims.document.shim.document.uchsc.ccp.uima.shim.DocumentMetaDataExtractor#extractDocumentId(org.apache.uima.jcas.JCas)
{'fraction_non_alphanumeric': 0.11576673866090713, 'fraction_numerical': 0.0008639308855291577, 'mean_word_length': 5.636103151862464, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '6749827', 'n_tokens_mistral': 841, 'n_tokens_neox': 826, 'n_words': 97}