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

exports['initialize'] = function (test) {
    test.equal(preciosa.initialize(), null);
};

exports['load brands and companies'] = function (test) {
    preciosa.loadMarcasFabricantes();
    
    var marca = preciosa.getMarca(1);
    test.ok(marca);
    test.equal(marca.id, 1);
    test.equal(marca.nombre, 'Coca Cola');
    test.equal(marca.fabricanteid, 1);
    
    var fabricante = preciosa.getFabricante(1);
    test.ok(fabricante);
    test.equal(fabricante.id, 1);
    test.equal(fabricante.nombre, 'Coca-Cola de Argentina');
};

exports['Retrieve company'] = function (test) {
    var result = preciosa.search('argentina cola coca');
    
    test.ok(result);
    test.ok(Array.isArray(result));
    test.ok(result.length);

};

exports['Retrieve brand'] = function (test) {
    var result = preciosa.search('fanta');
    
    test.ok(result);
    test.ok(Array.isArray(result));
    test.ok(result.length);
};

exports['Load categories'] = function (test) {
    preciosa.loadCategorias();
    
    var result = preciosa.getCategoria(2);
    
    test.ok(result);
    test.equal(result.id, 2);
    test.equal(result.nombre, 'Almacen');
};

exports['Retrieve category'] = function (test) {
    var result = preciosa.search('almacen');
    
    test.ok(result);
    test.ok(Array.isArray(result));
    test.ok(result.length);
};

exports['Analyze company'] = function (test) {
    var result = preciosa.analyze('coca cola argentina');
    
    test.ok(result);

    test.equal(result.fabricanteid, 1);

    test.equal(result.fabricante, 'Coca-Cola de Argentina');

};

exports['Analyze category'] = function (test) {
    var result = preciosa.analyze('almacen');
    
    test.ok(result);
    test.equal(result.categoriaid, 2);
    test.equal(result.categoria, 'Almacen');
};

exports['Analyze brand'] = function (test) {
    var result = preciosa.analyze('coca cola');
    
    test.ok(result);
    test.equal(result.marcaid, 1);
    test.equal(result.marca, 'Coca Cola');
    test.equal(result.fabricanteid, 1);
    test.equal(result.fabricante, 'Coca-Cola de Argentina');
};

exports['Analyze category with product in singular'] = function (test) {
    var result = preciosa.analyze('aceite');
    
    test.ok(result);
    test.equal(result.categoriaid, 937);
    test.equal(result.categoria, 'Aceites y cremas');
};

exports['Analyze category with product in singular and e vowel'] = function (test) {
    var result = preciosa.analyze('colchon');
    
    test.ok(result);
    test.equal(result.categoriaid, 331);
    test.equal(result.categoria, 'Colchones y sommier');
};

exports['Analyze liter'] = function (test) {
    var result = preciosa.analyze('1 lt');
    
    test.ok(result);
    test.equal(result.tamanio, 1);
    test.equal(result.unidad, 'litro');
};

exports['Analyze liters'] = function (test) {
    var result = preciosa.analyze('10 lts');
    
    test.ok(result);
    test.equal(result.tamanio, 10);
    test.equal(result.unidad, 'litro');
};

exports['Load products'] = function (test) {
    preciosa.loadProductos();
    
    var result = preciosa.getProducto(1);
    
    test.ok(result);
    test.equal(result.id, 1);
    test.ok(result.nombre);
    test.ok(result.upc);
};<commit_msg>Fixing volume test, adding weight tests<commit_after>
var preciosa = require('../preciosa');

exports['initialize'] = function (test) {
    test.equal(preciosa.initialize(), null);
};

exports['load brands and companies'] = function (test) {
    preciosa.loadMarcasFabricantes();
    
    var marca = preciosa.getMarca(1);
    test.ok(marca);
    test.equal(marca.id, 1);
    test.equal(marca.nombre, 'Coca Cola');
    test.equal(marca.fabricanteid, 1);
    
    var fabricante = preciosa.getFabricante(1);
    test.ok(fabricante);
    test.equal(fabricante.id, 1);
    test.equal(fabricante.nombre, 'Coca-Cola de Argentina');
};

exports['Retrieve company'] = function (test) {
    var result = preciosa.search('argentina cola coca');
    
    test.ok(result);
    test.ok(Array.isArray(result));
    test.ok(result.length);

};

exports['Retrieve brand'] = function (test) {
    var result = preciosa.search('fanta');
    
    test.ok(result);
    test.ok(Array.isArray(result));
    test.ok(result.length);
};

exports['Load categories'] = function (test) {
    preciosa.loadCategorias();
    
    var result = preciosa.getCategoria(2);
    
    test.ok(result);
    test.equal(result.id, 2);
    test.equal(result.nombre, 'Almacen');
};

exports['Retrieve category'] = function (test) {
    var result = preciosa.search('almacen');
    
    test.ok(result);
    test.ok(Array.isArray(result));
    test.ok(result.length);
};

exports['Analyze company'] = function (test) {
    var result = preciosa.analyze('coca cola argentina');
    
    test.ok(result);

    test.equal(result.fabricanteid, 1);

    test.equal(result.fabricante, 'Coca-Cola de Argentina');

};

exports['Analyze category'] = function (test) {
    var result = preciosa.analyze('almacen');
    
    test.ok(result);
    test.equal(result.categoriaid, 2);
    test.equal(result.categoria, 'Almacen');
};

exports['Analyze brand'] = function (test) {
    var result = preciosa.analyze('coca cola');
    
    test.ok(result);
    test.equal(result.marcaid, 1);
    test.equal(result.marca, 'Coca Cola');
    test.equal(result.fabricanteid, 1);
    test.equal(result.fabricante, 'Coca-Cola de Argentina');
};

exports['Analyze category with product in singular'] = function (test) {
    var result = preciosa.analyze('aceite');
    
    test.ok(result);
    test.equal(result.categoriaid, 937);
    test.equal(result.categoria, 'Aceites y cremas');
};

exports['Analyze category with product in singular and e vowel'] = function (test) {
    var result = preciosa.analyze('colchon');
    
    test.ok(result);
    test.equal(result.categoriaid, 331);
    test.equal(result.categoria, 'Colchones y sommier');
};

exports['Analyze liter'] = function (test) {
    var result = preciosa.analyze('1 lt');
    
    test.ok(result);
    test.equal(result.volumen, 1);
    test.equal(result.unidad_volumen, 'litro');
};

exports['Analyze liters'] = function (test) {
    var result = preciosa.analyze('10 lts');
    
    test.ok(result);
    test.equal(result.volumen, 10);
    test.equal(result.unidad_volumen, 'litro');
};

exports['Analyze gram'] = function (test) {
    var result = preciosa.analyze('1 gr');
    
    test.ok(result);
    test.equal(result.peso, 1);
    test.equal(result.unidad_peso, 'gramo');
};

exports['Analyze liters'] = function (test) {
    var result = preciosa.analyze('10 grs');
    
    test.ok(result);
    test.equal(result.peso, 10);
    test.equal(result.unidad_peso, 'gramo');
};

exports['Load products'] = function (test) {
    preciosa.loadProductos();
    
    var result = preciosa.getProducto(1);
    
    test.ok(result);
    test.equal(result.id, 1);
    test.ok(result.nombre);
    test.ok(result.upc);
};
{'fraction_non_alphanumeric': 0.1626376770133028, 'fraction_numerical': 0.008010298955800315, 'mean_word_length': 3.5461638491547465, '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': '3931845', 'n_tokens_mistral': 2518, 'n_tokens_neox': 2469, 'n_words': 447}