<commit_before>package br.com.dbsoft.document;
import java.io.File;
import java.io.IOException;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.apache.log4j.Logger;
import org.w3c.dom.Attr;
import org.w3c.dom.CDATASection;
import org.w3c.dom.Comment;
import org.w3c.dom.DOMConfiguration;
import org.w3c.dom.DOMException;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentFragment;
import org.w3c.dom.DocumentType;
import org.w3c.dom.Element;
import org.w3c.dom.EntityReference;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.ProcessingInstruction;
import org.w3c.dom.Text;
import org.w3c.dom.UserDataHandler;
import org.xml.sax.SAXException;

import br.com.dbsoft.core.DBSSDK;

public class DBSDocument implements Document {
	protected Logger	wLogger = Logger.getLogger(this.getClass());
	
	private DocumentBuilderFactory 	wDocFactory = DocumentBuilderFactory.newInstance();
	private DocumentBuilder 		wDocBuilder;
	private Document 				wDoc;
	
	public DBSDocument() {
		try {
			//Desabilita validações padrão para que a Parse seja executado mais rápido
			wDocFactory.setNamespaceAware(false);
			wDocFactory.setValidating(false);
			wDocFactory.setFeature("http://xml.org/sax/features/namespaces", false);
			wDocFactory.setFeature("http://xml.org/sax/features/validation", false);
			wDocFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false);
			wDocFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
			//------------------------
			wDocBuilder = wDocFactory.newDocumentBuilder();
		} catch (ParserConfigurationException e) {
			wLogger.error(e);
		} 
	}
	
	public boolean open(File pFile){
		try {
			wDoc = wDocBuilder.parse(pFile);
			return true;
		} catch (SAXException | IOException e) {
			wLogger.error(e);
			return false;
		}
	}<commit_msg>metodo open renomeado para read.<commit_after>package br.com.dbsoft.document;
import java.io.File;
import java.io.IOException;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.apache.log4j.Logger;
import org.w3c.dom.Attr;
import org.w3c.dom.CDATASection;
import org.w3c.dom.Comment;
import org.w3c.dom.DOMConfiguration;
import org.w3c.dom.DOMException;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentFragment;
import org.w3c.dom.DocumentType;
import org.w3c.dom.Element;
import org.w3c.dom.EntityReference;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.ProcessingInstruction;
import org.w3c.dom.Text;
import org.w3c.dom.UserDataHandler;
import org.xml.sax.SAXException;

import br.com.dbsoft.core.DBSSDK;

public class DBSDocument implements Document {
	protected Logger	wLogger = Logger.getLogger(this.getClass());
	
	private DocumentBuilderFactory 	wDocFactory = DocumentBuilderFactory.newInstance();
	private DocumentBuilder 		wDocBuilder;
	private Document 				wDoc;
	
	public DBSDocument() {
		try {
			//Desabilita validações padrão para que a Parse seja executado mais rápido
			wDocFactory.setNamespaceAware(false);
			wDocFactory.setValidating(false);
			wDocFactory.setFeature("http://xml.org/sax/features/namespaces", false);
			wDocFactory.setFeature("http://xml.org/sax/features/validation", false);
			wDocFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false);
			wDocFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
			//------------------------
			wDocBuilder = wDocFactory.newDocumentBuilder();
		} catch (ParserConfigurationException e) {
			wLogger.error(e);
		} 
	}
	
	public boolean read(File pFile){
		try {
			wDoc = wDocBuilder.parse(pFile);
			return true;
		} catch (SAXException | IOException e) {
			wLogger.error(e);
			return false;
		}
	}
{'fraction_non_alphanumeric': 0.12709599027946536, 'fraction_numerical': 0.008748481166464156, 'mean_word_length': 4.638356164383562, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, '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': '4887940', 'n_tokens_mistral': 1472, 'n_tokens_neox': 1378, 'n_words': 238}