<commit_before>package com.thaiopensource.relaxng;

import org.xml.sax.SAXParseException;
import org.xml.sax.SAXException;
import org.xml.sax.Locator;
import org.xml.sax.XMLReader;
import org.xml.sax.ErrorHandler;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
import org.xml.sax.helpers.LocatorImpl;

import java.util.Hashtable;
import java.util.Enumeration;
import java.util.Vector;

import com.thaiopensource.datatype.DatatypeContext;

public class Validator implements KeyChecker {
  PatternBuilder b;
  Locator locator;
  private XMLReader xr;
  private boolean hadError = false;
  boolean keyAmbig;

  static final int RECOVERY_ATTEMPTS = 4;
  PrefixMapping prefixMapping = new PrefixMapping("xml", PatternReader.xmlURI, null);

  static final class PrefixMapping implements DatatypeContext {
    private final String prefix;
    private final String namespaceURI;<commit_msg>Use at most 2 recovery attempts.<commit_after>package com.thaiopensource.relaxng;

import org.xml.sax.SAXParseException;
import org.xml.sax.SAXException;
import org.xml.sax.Locator;
import org.xml.sax.XMLReader;
import org.xml.sax.ErrorHandler;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
import org.xml.sax.helpers.LocatorImpl;

import java.util.Hashtable;
import java.util.Enumeration;
import java.util.Vector;

import com.thaiopensource.datatype.DatatypeContext;

public class Validator implements KeyChecker {
  PatternBuilder b;
  Locator locator;
  private XMLReader xr;
  private boolean hadError = false;
  boolean keyAmbig;

  static final int RECOVERY_ATTEMPTS = 2;
  PrefixMapping prefixMapping = new PrefixMapping("xml", PatternReader.xmlURI, null);

  static final class PrefixMapping implements DatatypeContext {
    private final String prefix;
    private final String namespaceURI;
{'fraction_non_alphanumeric': 0.08257858284496537, 'fraction_numerical': 0.0015982951518380393, 'mean_word_length': 5.3232323232323235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 22}, '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': '6978040', 'n_tokens_mistral': 599, 'n_tokens_neox': 588, 'n_words': 146}