<commit_before>package org.meaningfulweb.util;

import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.StringUtils;

public class URIUtils {

  private static Map<String, String> unsafe = new HashMap<String, String>();
  static {
    unsafe.put(" ", "20");
    unsafe.put("\"", "22");
    unsafe.put("#", "23");
    unsafe.put("%", "25");
    unsafe.put("<", "3C");
    unsafe.put(">", "3E");
    unsafe.put("{", "7B");
    unsafe.put("}", "7D");
    unsafe.put("|", "7C");
    unsafe.put("\\", "5C");
    unsafe.put("^", "7E");
    unsafe.put("~", "5E");
    unsafe.put("[", "5B");
    unsafe.put("]", "5D");
    unsafe.put("`", "60");
  }

  private static Map<String, String> reserved = new HashMap<String, String>();
  static {
    reserved.put("$", "24");
    reserved.put("&", "26");
    reserved.put("+", "2B");
    reserved.put(",", "2C");
    reserved.put("/", "2F");
    reserved.put(":", "3A");<commit_msg>fixed a corner case where there are bad chars in img link<commit_after>package org.meaningfulweb.util;

import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.StringUtils;

public class URIUtils {

  private static Map<String, String> unsafe = new HashMap<String, String>();
  static {
    unsafe.put(" ", "20");
    unsafe.put("\"", "22");
    unsafe.put("#", "23");
    unsafe.put("%", "25");
    unsafe.put("<", "3C");
    unsafe.put(">", "3E");
    unsafe.put("{", "7B");
    unsafe.put("}", "7D");
    unsafe.put("|", "7C");
    unsafe.put("\\", "5C");
    unsafe.put("^", "7E");
    unsafe.put("~", "5E");
    unsafe.put("[", "5B");
    unsafe.put("]", "5D");
    unsafe.put("`", "60");
    unsafe.put("\n", "20");
    unsafe.put("\r", "20");
    unsafe.put("\t", "20");
  }

  private static Map<String, String> reserved = new HashMap<String, String>();
  static {
    reserved.put("$", "24");
    reserved.put("&", "26");
    reserved.put("+", "2B");
    reserved.put(",", "2C");
    reserved.put("/", "2F");
    reserved.put(":", "3A");
{'fraction_non_alphanumeric': 0.25390984360625574, 'fraction_numerical': 0.028518859245630176, 'mean_word_length': 3.512448132780083, 'pattern_counts': {'":': 2, '<': 13, '<?xml version=': 0, '>': 13, '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': '7151602', 'n_tokens_mistral': 799, 'n_tokens_neox': 786, 'n_words': 170}