<commit_before>package com.taxonic.carml.util;

import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

/**
 * Percent-encodes any characters in a {@code String} that are
 * NOT one of the following:
 * - alphabetic, as per {@code Character::isAlphabetic}
 * - a digit, as per {@code Character::isDigit)
 * - a dash (-), dot (.), underscore (_) or tilde (~)
 * - part of any of the ranges of character codes specified when
 *   creating the {@code IriEncoder} through its constructor {@link #IriEncoder()}.
 *   When creating an {@code IriEncoder} through {@link #create}, these ranges
 *   correspond to the {@code ucschar} production rule from RFC-TODO.
 */
public class IriEncoder implements Function<String, String> {

	public static String encode(String input) {
		return create().apply(input);
	}
	
	static class Range {
		
		final int from, to;

		Range(int from, int to) {
			this.from = from;<commit_msg>fix javadoc<commit_after>package com.taxonic.carml.util;

import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

/**
 * Percent-encodes any characters in a {@code String} that are
 * NOT one of the following:
 * - alphabetic, as per {@code Character::isAlphabetic}
 * - a digit, as per {@code Character::isDigit}
 * - a dash (-), dot (.), underscore (_) or tilde (~)
 * - part of any of the ranges of character codes specified when
 *   creating the {@code IriEncoder} through its constructor {@link #IriEncoder(List)}.
 *   When creating an {@code IriEncoder} through {@link #create}, these ranges
 *   correspond to the {@code ucschar} production rule from RFC-TODO.
 */
public class IriEncoder implements Function<String, String> {

	public static String encode(String input) {
		return create().apply(input);
	}
	
	static class Range {
		
		final int from, to;

		Range(int from, int to) {
			this.from = from;
{'fraction_non_alphanumeric': 0.11834319526627218, 'fraction_numerical': 0.0, 'mean_word_length': 4.0725, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3872050', 'n_tokens_mistral': 635, 'n_tokens_neox': 603, 'n_words': 216}