<commit_before>package pointGroups.util.polymake.wrapper;

import java.io.InputStream;

class PolymakeResultHandler implements Runnable {

	public PolymakeResultHandler(PolymakeWrapper polymakeWrapper, InputStream inputStream) {
		// TODO Auto-generated constructor stub
	}

	@Override
	public void run() {
		// TODO Auto-generated method stub

	}

}<commit_msg>implemented result fetch loop in polymake wrapper package<commit_after>package pointGroups.util.polymake.wrapper;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

class PolymakeResultHandler implements Runnable {
	private final BufferedReader res;
	private final PolymakeWrapper wrapper;

	public PolymakeResultHandler(PolymakeWrapper polymakeWrapper,
			InputStream inputStream) {
		this.res = new BufferedReader(new InputStreamReader(inputStream));
		this.wrapper = polymakeWrapper;
	}

	@Override
	public void run() {
		String output;
		StringBuilder sb = new StringBuilder();
		try {
			while ((output = this.res.readLine()) != null) {
				// TODO: String constants
				if (output.equals("__END__")) {
					this.wrapper.onMessageReceived(sb.toString());
					sb = new StringBuilder();
				} else {
					sb.append(output + "\n");
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
{'fraction_non_alphanumeric': 0.09917971662938106, 'fraction_numerical': 0.0, 'mean_word_length': 4.455284552845528, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2563696', 'n_tokens_mistral': 440, 'n_tokens_neox': 386, 'n_words': 96}