<commit_before>package com.mysema.stat.pcaxis;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.antlr.runtime.ANTLRInputStream;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.RecognitionException;

public class PCAxis {

    public static final Key DATA = new Key("DATA");
    
    public static final Key HEADING = new Key("HEADING");
    
    public static final Key STUB = new Key("STUB");
    
    public static final Key TITLE = new Key("TITLE");

    public static Object convert(String value) {
        if (value.startsWith("\"")) {
            return value.substring(1, value.length() - 1);
        } else {
            return new BigDecimal(value);
        }
    }
    
    public static String convertString(String value) {
        return value.substring(1, value.length() - 1);
    }
    
    @SuppressWarnings("unchecked")
    public static Map<Key, List<Object>> parse(String fileName) {
        try {
            InputStream in = new FileInputStream(fileName);
            // create a CharStream that reads from standard input
            ANTLRInputStream input = new ANTLRInputStream(in, "Windows-1252"); // create a lexer that feeds off of input CharStream
            PCAxisANTLRLexer lexer = new PCAxisANTLRLexer(input); // create a buffer of tokens pulled from the lexer
            CommonTokenStream tokens = new CommonTokenStream(lexer);
            // create a parser that feeds off the tokens buffer
            PCAxisANTLRParser parser = new PCAxisANTLRParser(tokens); // begin parsing at rule r parser.r();
            
            return (Map<Key, List<Object>>) parser.px().result;
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (RecognitionException e) {
            throw new RuntimeException(e);
        }
    }
    
}
<commit_msg>fixed Sonar issues<commit_after>package com.mysema.stat.pcaxis;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.antlr.runtime.ANTLRInputStream;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.RecognitionException;

public final class PCAxis {

    public static final Key DATA = new Key("DATA");
    
    public static final Key HEADING = new Key("HEADING");
    
    public static final Key STUB = new Key("STUB");
    
    public static final Key TITLE = new Key("TITLE");

    public static Object convert(String value) {
        if (value.startsWith("\"")) {
            return value.substring(1, value.length() - 1);
        } else {
            return new BigDecimal(value);
        }
    }
    
    public static String convertString(String value) {
        return value.substring(1, value.length() - 1);
    }
    
    @SuppressWarnings("unchecked")
    public static Map<Key, List<Object>> parse(String fileName) {
        try {
            InputStream in = new FileInputStream(fileName);
            // create a CharStream that reads from standard input
            ANTLRInputStream input = new ANTLRInputStream(in, "Windows-1252"); // create a lexer that feeds off of input CharStream
            PCAxisANTLRLexer lexer = new PCAxisANTLRLexer(input); // create a buffer of tokens pulled from the lexer
            CommonTokenStream tokens = new CommonTokenStream(lexer);
            // create a parser that feeds off the tokens buffer
            PCAxisANTLRParser parser = new PCAxisANTLRParser(tokens); // begin parsing at rule r parser.r();
            
            return (Map<Key, List<Object>>) parser.px().result;
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (RecognitionException e) {
            throw new RuntimeException(e);
        }
    }
    
    private PCAxis(){}
    
}

{'fraction_non_alphanumeric': 0.0947075208913649, 'fraction_numerical': 0.004051658647758926, 'mean_word_length': 2.600729261622607, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2883667', 'n_tokens_mistral': 1113, 'n_tokens_neox': 1082, 'n_words': 327}