<commit_before>/**
 * icu-converter
 * https://github.com/alex-dow/icu-converter
 *
 * Copyright (c) 2015 <NAME>
 * Licensed under the MIT License
 * https://github.com/alex-dow/icu-converter/blob/master/LICENSE
 */
'use strict';

var _ = require('lodash');
var fs = require('fs');
var parser = require('./icu-format-parser');
// var ASTObject = require('./icu-ast');

var ICUConverter = function(opts) {

    var defaultOptions = {
        format: 'json',
        outputDir: '.',
        encoding: 'utf-8',
        writerOptions: {} 
    };

    this.options = _.defaults({}, opts, defaultOptions);
  
    this.validTypes = [
      'array',
      'string',
      'table'
    ];
}


function endsWith(str, suffix) {
    return str.indexOf(suffix, str.length - suffix.length) !== -1;
}

ICUConverter.prototype.parse = function(grammar) {
  return parser.parse(grammar);
};

ICUConverter.prototype.parseKeyname = function(keyname) {

  this.validTypes.forEach(function(type) {
    var keyType = ':' + type;<commit_msg>Added missing semicolon<commit_after>/**
 * icu-converter
 * https://github.com/alex-dow/icu-converter
 *
 * Copyright (c) 2015 <NAME>
 * Licensed under the MIT License
 * https://github.com/alex-dow/icu-converter/blob/master/LICENSE
 */
'use strict';

var _ = require('lodash');
var fs = require('fs');
var parser = require('./icu-format-parser');
// var ASTObject = require('./icu-ast');

var ICUConverter = function(opts) {

    var defaultOptions = {
        format: 'json',
        outputDir: '.',
        encoding: 'utf-8',
        writerOptions: {} 
    };

    this.options = _.defaults({}, opts, defaultOptions);
  
    this.validTypes = [
      'array',
      'string',
      'table'
    ];
};


function endsWith(str, suffix) {
    return str.indexOf(suffix, str.length - suffix.length) !== -1;
}

ICUConverter.prototype.parse = function(grammar) {
  return parser.parse(grammar);
};

ICUConverter.prototype.parseKeyname = function(keyname) {

  this.validTypes.forEach(function(type) {
    var keyType = ':' + type;
{'fraction_non_alphanumeric': 0.16691140479686736, 'fraction_numerical': 0.005873715124816446, 'mean_word_length': 3.096192384769539, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '1835891', 'n_tokens_mistral': 691, 'n_tokens_neox': 661, 'n_words': 127}