<commit_before>/**
 * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
 *
 * @author <NAME>
 */
/**
 * Adapted from MolQL src/transpile.ts
 */

import { Transpiler } from './transpilers/transpiler';
import { _transpiler } from './transpilers/all';
const transpiler: {[index: string]: Transpiler} = _transpiler;

export function parse(lang: string, str: string) {
    try {
        const query = transpiler[lang](str);

        console.log(str);
        //	console.log(util.inspect(query, {depth: 20, color: true}))
        console.log('\n');

        return query;
    } catch (e) {
        console.log(str);
        console.log(e.message);
        console.log('\n');
    }
}<commit_msg>let transpile.ts show what the query is<commit_after>/**
 * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
 *
 * @author <NAME>
 */
/**
 * Adapted from MolQL src/transpile.ts
 */

import { Transpiler } from './transpilers/transpiler';
import { _transpiler } from './transpilers/all';
const transpiler: {[index: string]: Transpiler} = _transpiler;

export function parse(lang: string, str: string) {
    try {
        const query = transpiler[lang](str);

        console.log(str);
	console.log(query);
        //	console.log(util.inspect(query, {depth: 20, color: true}))
        console.log('\n');

        return query;
    } catch (e) {
        console.log(str);
        console.log(e.message);
        console.log('\n');
    }
}
{'fraction_non_alphanumeric': 0.1550232867598137, 'fraction_numerical': 0.007984031936127744, 'mean_word_length': 2.866323907455013, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1525241', 'n_tokens_mistral': 501, 'n_tokens_neox': 482, 'n_words': 125}