<commit_before>// LICENSE : MIT
"use strict";
import {RuleHelper} from "textlint-rule-helper";

function countMatchContent(text, reg) {
    var count = 0;
    var matches = text.match(reg) || [];
    count += matches.length;
    return {count, matches};
}
function countMatchContentEnd(text, reg) {
    var count = 0;
    var lines = text.split(/\r\n|\r|\n|\u2028|\u2029/g);
    var matches = [];
    lines.forEach(line => {
        var match = line.match(reg) || [];
        matches = matches.concat(match);
        count += matches.length;
    });
    return {count, matches};<commit_msg>chore(rule): use let insteadof var<commit_after>// LICENSE : MIT
"use strict";
import {RuleHelper} from "textlint-rule-helper";

function countMatchContent(text, reg) {
    let count = 0;
    let matches = text.match(reg) || [];
    count += matches.length;
    return {count, matches};
}
function countMatchContentEnd(text, reg) {
    let count = 0;
    let lines = text.split(/\r\n|\r|\n|\u2028|\u2029/g);
    let matches = [];
    lines.forEach(line => {
        let match = line.match(reg) || [];
        matches = matches.concat(match);
        count += matches.length;
    });
    return {count, matches};
{'fraction_non_alphanumeric': 0.16402997502081598, 'fraction_numerical': 0.01665278934221482, 'mean_word_length': 2.966996699669967, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5654355', 'n_tokens_mistral': 394, 'n_tokens_neox': 381, 'n_words': 93}