<commit_before>var fs    = require('fs'),
    plist = require('plist'),
    CSON  = require('cson');

// Read grammar from plist
var psGrammarPlist = fs.readFileSync('vendor/EditorSyntax/PowerShellSyntax.tmLanguage', 'utf8')
var grammar = plist.parse(psGrammarPlist);

// Write out grammar as CSON
var csonGrammar = CSON.stringifySync(filterObject(grammar))
fs.writeFileSync('grammars/powershell.cson', csonGrammar, 'utf8')

// Helper function
// References: https://github.com/atom/apm/blob/c0d657af13a0da4acda6fd4be39eddded7aac1e3/src/package-converter.coffee#L73-75
function filterObject(obj) {
   delete obj.uuid
   delete obj.keyEquivalent
   return obj
}<commit_msg>Update script to utilize new method names<commit_after>var fs    = require('fs'),
    plist = require('plist'),
    CSON  = require('cson');

// Read grammar from plist
var psGrammarPlist = fs.readFileSync('vendor/EditorSyntax/PowerShellSyntax.tmLanguage', 'utf8')
var grammar = plist.parse(psGrammarPlist);

// Write out grammar as CSON
var csonGrammar = CSON.stringify(filterObject(grammar));
fs.writeFileSync('grammars/powershell.cson', csonGrammar, 'utf8');

// Helper function
// References: https://github.com/atom/apm/blob/c0d657af13a0da4acda6fd4be39eddded7aac1e3/src/package-converter.coffee#L73-75
function filterObject(obj) {
   delete obj.uuid
   delete obj.keyEquivalent
   return obj
}
{'fraction_non_alphanumeric': 0.12408759124087591, 'fraction_numerical': 0.030656934306569343, 'mean_word_length': 5.203619909502263, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2236586', 'n_tokens_mistral': 510, 'n_tokens_neox': 482, 'n_words': 88}