<commit_before>package cz.hobrasoft.pdfmu.jackson;

import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.module.jsonSchema.JsonSchema;
import com.fasterxml.jackson.module.jsonSchema.factories.SchemaFactoryWrapper;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 */
public class SchemaGenerator {

    public static void main(String[] args) throws JsonMappingException, IOException {
        ObjectMapper mapper = new ObjectMapper();
        mapper.enable(SerializationFeature.INDENT_OUTPUT); // nice formatting

        SchemaFactoryWrapper visitor = new SchemaFactoryWrapper();

        Map<String, Type> types = new HashMap<>();
        types.put("RpcResponse", RpcResponse.class);
        types.put("result/version get", VersionGet.class);
        types.put("result/signature display", SignatureDisplay.class);
        types.put("result/metadata get", MetadataGet.class);

        for (Map.Entry<String, Type> e : types.entrySet()) {
            String name = e.getKey();
            String filename = String.format("schema/%s.json", name);
            Type type = e.getValue();
            mapper.acceptJsonFormatVisitor(mapper.constructType(type), visitor);
            JsonSchema jsonSchema = visitor.finalSchema();
            mapper.writeValue(new File(filename), jsonSchema);
        }
    }
}<commit_msg>SchemaGenerator: Generate schemas of VersionSet, SignatureAdd, EmptyResult<commit_after>package cz.hobrasoft.pdfmu.jackson;

import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.module.jsonSchema.JsonSchema;
import com.fasterxml.jackson.module.jsonSchema.factories.SchemaFactoryWrapper;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 */
public class SchemaGenerator {

    public static void main(String[] args) throws JsonMappingException, IOException {
        ObjectMapper mapper = new ObjectMapper();
        mapper.enable(SerializationFeature.INDENT_OUTPUT); // nice formatting

        SchemaFactoryWrapper visitor = new SchemaFactoryWrapper();

        Map<String, Type> types = new HashMap<>();
        types.put("RpcResponse", RpcResponse.class);
        types.put("result/version get", VersionGet.class);
        types.put("result/version set", VersionSet.class);
        types.put("result/signature display", SignatureDisplay.class);
        types.put("result/signature add", SignatureAdd.class);
        types.put("result/metadata get", MetadataGet.class);
        types.put("result/empty", EmptyResult.class);

        for (Map.Entry<String, Type> e : types.entrySet()) {
            String name = e.getKey();
            String filename = String.format("schema/%s.json", name);
            Type type = e.getValue();
            mapper.acceptJsonFormatVisitor(mapper.constructType(type), visitor);
            JsonSchema jsonSchema = visitor.finalSchema();
            mapper.writeValue(new File(filename), jsonSchema);
        }
    }
}
{'fraction_non_alphanumeric': 0.121176813282843, 'fraction_numerical': 0.0, 'mean_word_length': 3.7300275482093666, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, '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': '533254', 'n_tokens_mistral': 964, 'n_tokens_neox': 910, 'n_words': 186}