<commit_before>package org.dannil.scbapi.utility;

import java.util.List;

import com.google.common.collect.ArrayListMultimap;

public final class QueryBuilder<E, K> {

	public QueryBuilder() {

	}

	public final String build(ArrayListMultimap<E, K> map) {
		StringBuilder builder = new StringBuilder();
		builder.append("{");
		builder.append("\"query\": [");
		int i = 0;
		for (E code : map.keySet()) {
			builder.append("{");
			builder.append("\"code\": \"" + code + "\",");
			builder.append("\"selection\": {");
			builder.append("\"filter\": \"item\",");
			builder.append("\"values\": [");
			List<K> values = map.get(code);
			for (int j = 0; j < values.size(); j++) {
				builder.append("\"" + values.get(j) + "\"");
				if (j != values.size() - 1) {
					builder.append(",");
				}
			}
			builder.append("]");
			builder.append("}");
			builder.append("}");
			if (i != map.keySet().size() - 1) {
				builder.append(",");
			}
		}
		builder.append("],");
		builder.append("\"response\": {");
		builder.append("\"format\": \"json\"");
		builder.append("}");
		builder.append("}");

		return builder.toString();
	}

}<commit_msg>Added missing incrementor, which resulted in invalid JSON<commit_after>package org.dannil.scbapi.utility;

import java.util.List;

import com.google.common.collect.ArrayListMultimap;

public final class QueryBuilder<E, K> {

	public QueryBuilder() {

	}

	public final String build(ArrayListMultimap<E, K> map) {
		StringBuilder builder = new StringBuilder();
		builder.append("{");
		builder.append("\"query\": [");
		int i = 0;
		for (E code : map.keySet()) {
			builder.append("{");
			builder.append("\"code\": \"" + code + "\",");
			builder.append("\"selection\": {");
			builder.append("\"filter\": \"item\",");
			builder.append("\"values\": [");
			List<K> values = map.get(code);
			for (int j = 0; j < values.size(); j++) {
				builder.append("\"" + values.get(j) + "\"");
				if (j != values.size() - 1) {
					builder.append(",");
				}
			}
			builder.append("]");
			builder.append("}");
			builder.append("}");
			if (i != map.keySet().size() - 1) {
				builder.append(",");
			}
			i++;
		}
		builder.append("],");
		builder.append("\"response\": {");
		builder.append("\"format\": \"json\"");
		builder.append("}");
		builder.append("}");

		return builder.toString();
	}

}
{'fraction_non_alphanumeric': 0.24099485420240138, 'fraction_numerical': 0.003430531732418525, 'mean_word_length': 3.3689138576779025, 'pattern_counts': {'":': 14, '<': 11, '<?xml version=': 0, '>': 9, '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': '4937134', 'n_tokens_mistral': 920, 'n_tokens_neox': 798, 'n_words': 152}