<commit_before>package jules;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import util.Pair;

public class Categorizer {
	
	public static void main(String[] args){
		getCategories("<NAME>?");
	}

	public static List<Pair> getCategories(String q) {
		String question = q;
		StringBuffer output = new StringBuffer();
		String[] cmdarray = {"bash","-c", "cd ./libshorttext-1.1 && ./demo.py " + q};
		try {
			Process p = Runtime.getRuntime().exec(cmdarray);
		    p.waitFor();
		
		    BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
		 
		    StringBuilder sb = new StringBuilder();
		    String line = "";
		    String categories = "";
		    String decvals = "";
		    boolean catComming = false;
	    
			while ((line = reader.readLine())!= null) {
				if(catComming){
					categories = line.trim();
					catComming = false;
				} 
				
				if (line.contains(question)){
					catComming = true;
				}
				
				if(line.contains("decval")){
					decvals = line.substring(10).trim();
				}<commit_msg>add eaasy testing for classification of question<commit_after>package jules;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import util.Pair;

public class Categorizer {
	
	public static void main(String[] args){
		String q = "";
		while(!(q = System.console().readLine("Enter a question: ")).equals("q")){
			getCategories(q);
		}
	}

	public static List<Pair> getCategories(String q) {
		String question = q;
		StringBuffer output = new StringBuffer();
		String[] cmdarray = {"bash","-c", "cd ./libshorttext-1.1 && ./demo.py " + q};
		try {
			Process p = Runtime.getRuntime().exec(cmdarray);
		    p.waitFor();
		
		    BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
		 
		    StringBuilder sb = new StringBuilder();
		    String line = "";
		    String categories = "";
		    String decvals = "";
		    boolean catComming = false;
	    
			while ((line = reader.readLine())!= null) {
				if(catComming){
					categories = line.trim();
					catComming = false;
				} 
				
				if (line.contains(question)){
					catComming = true;
				}
				
				if(line.contains("decval")){
					decvals = line.substring(10).trim();
				}
{'fraction_non_alphanumeric': 0.141846921797005, 'fraction_numerical': 0.0033277870216306157, 'mean_word_length': 3.1898954703832754, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '4652604', 'n_tokens_mistral': 880, 'n_tokens_neox': 725, 'n_words': 175}