<commit_before>var cheerio = require('cheerio');
var parserUtil = require('./parserUtil');

module.exports = new (function () {
    this.parse = function (html, callback) {

        var $ = cheerio.load(html);

        var menu = new Array();
        var todayStr = global.todaysDate.format("DD. MM. YYYY");

        $('.menublock').each(function () {
            var leftCellText = $(this).children("div").first().text();
            if (leftCellText.indexOf(todayStr) !== -1) {
                var match = /€(\d[\.,]\d{2})/.exec(leftCellText);
                var price = match ? parseFloat(match[1]) : NaN;
                var items = $(this).children("div").eq(1).text().match(/[^\r\n]+/g);
                menu = items.map(function(item, index){
                    var tmp = {isSoup: false, text: normalize(item), price: price };
                    if(index === 0) {//I think it is safe enough to assume that the first item in menu is the soup
                        tmp.isSoup = true;
                        tmp.price = NaN;
                    }
                    return tmp;
                });
                callback(false);
            }
        });

        function normalize(str) {
            return str.normalizeWhitespace()
                .removeMetrics();
        }
        
        callback(menu);
    };
})();<commit_msg>Fixed a mistake that we should not talk about<commit_after>var cheerio = require('cheerio');
var parserUtil = require('./parserUtil');

module.exports = new (function () {
    this.parse = function (html, callback) {

        var $ = cheerio.load(html);

        var menu = new Array();
        var todayStr = global.todaysDate.format("DD. MM. YYYY");

        $('.menublock').each(function () {
            var leftCellText = $(this).children("div").first().text();
            if (leftCellText.indexOf(todayStr) !== -1) {
                var match = /€(\d[\.,]\d{2})/.exec(leftCellText);
                var price = match ? parseFloat(match[1]) : NaN;
                var items = $(this).children("div").eq(1).text().match(/[^\r\n]+/g);
                menu = items.map(function(item, index){
                    var tmp = {isSoup: false, text: normalize(item), price: price };
                    if(index === 0) {//I think it is safe enough to assume that the first item in menu is the soup
                        tmp.isSoup = true;
                        tmp.price = NaN;
                    }
                    return tmp;
                });
                return false;
            }
        });

        function normalize(str) {
            return str.normalizeWhitespace()
                .removeMetrics();
        }
        
        callback(menu);
    };
})();
{'fraction_non_alphanumeric': 0.1496149614961496, 'fraction_numerical': 0.003667033370003667, 'mean_word_length': 1.544776119402985, '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': '1313705', 'n_tokens_mistral': 774, 'n_tokens_neox': 727, 'n_words': 179}