<commit_before>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package nl.mpi.kinnate.kindocument;

import java.util.HashMap;

/**
 *  Document   : ImportTranslator
 *  Created on : Aug 18, 2011, 11:53:44 AM
 *  Author     : <NAME>
 */
public class ImportTranslator {

    private HashMap<TranslationElement, TranslationElement> translateTable;
    boolean ignoreCase;

    public class TranslationElement {

        String fieldName;
        String fieldValue;

        public TranslationElement(String fieldName, String fieldValue) {
            this.fieldName = fieldName.replaceAll("\\s", "_");
            this.fieldValue = fieldValue;
        }

        private String checkCase(String inputString) {<commit_msg>Refactored to match recent changes to Arbil so that singletons are not static but are injected via the constructor. Added testes for the import translator and import character escaping process. Update the CSV import to support more formats.<commit_after>package nl.mpi.kinnate.kindocument;

import java.util.HashMap;

/**
 *  Document   : ImportTranslator
 *  Created on : Aug 18, 2011, 11:53:44 AM
 *  Author     : <NAME>
 */
public class ImportTranslator {

    private HashMap<TranslationElement, TranslationElement> translateTable;
    boolean ignoreCase;

    public class TranslationElement {

        String fieldName;
        String fieldValue;

        public TranslationElement(String fieldName, String fieldValue) {
            this.fieldName = fieldName.replaceAll("[^a-zA-Z0-9]+", "_");
            this.fieldValue = fieldValue;
        }

        private String checkCase(String inputString) {
{'fraction_non_alphanumeric': 0.08169350029815146, 'fraction_numerical': 0.015503875968992248, 'mean_word_length': 3.1845386533665834, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4231365', 'n_tokens_mistral': 474, 'n_tokens_neox': 432, 'n_words': 140}