<commit_before>package com.microservices.rentaloffer;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SolutionCollector implements MessageHandler {

    protected static Logger logger = LoggerFactory.getLogger(SolutionCollector.class);

    public static void main(String[] args) {
        String host = args[0];
        String port = args[1];

        Connections connection = new Connections(host, port);
        connection.deliveryLoop(new SolutionCollector());
    }

    public void handle(String message) {
        final NeedPacket needPacket = NeedPacket.fromJson(message);
        if (needPacket.hasSolutions()) {
            List<Solution> solutions = needPacket.getSolutions();
            Solution solution = getBest(solutions);
            logger.info("BEST: " + solution.toJson());

        }
    }

    private Solution getBest(List<Solution> solutions) {
        double highestScore = 0;
        Solution bestSolution = null;

        for (Solution solution : solutions) {<commit_msg>added num solution in collector logging<commit_after>package com.microservices.rentaloffer;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SolutionCollector implements MessageHandler {

    protected static Logger logger = LoggerFactory.getLogger(SolutionCollector.class);

    public static void main(String[] args) {
        String host = args[0];
        String port = args[1];

        Connections connection = new Connections(host, port);
        connection.deliveryLoop(new SolutionCollector());
    }

    public void handle(String message) {
        final NeedPacket needPacket = NeedPacket.fromJson(message);
        if (needPacket.hasSolutions()) {
            List<Solution> solutions = needPacket.getSolutions();
            Solution solution = getBest(solutions);
            logger.info("BEST of (" + solutions.size() + "): " + solution.toJson());

        }
    }

    private Solution getBest(List<Solution> solutions) {
        double highestScore = 0;
        Solution bestSolution = null;

        for (Solution solution : solutions) {
{'fraction_non_alphanumeric': 0.09534883720930233, 'fraction_numerical': 0.004651162790697674, 'mean_word_length': 3.128598848368522, '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': '2654876', 'n_tokens_mistral': 580, 'n_tokens_neox': 548, 'n_words': 143}