<commit_before>import qbs 1.0
import qbs.File
import qbs.Fileinfo
import "utils.js" as Utils

Probe {
    // Inputs
    property stringList names
    property var nameFilter
    property pathList pathPrefixes
    property stringList pathSuffixes
    property pathList platformPaths: [ '/usr', '/usr/local' ]
    property pathList environmentPaths
    property pathList platformEnvironmentPaths

    // Output
    property string path
    property string filePath
    property string fileName

    configure: {
        if (!names)
            throw '"names" must be specified';
        var _names = Utils.concatAll(names);
        if (nameFilter)
            _names = _names.map(nameFilter);
        // FIXME: Suggest how to obtain paths from system
        var _paths = Utils.concatAll(pathPrefixes, platformPaths);
        // FIXME: Add getenv support
        var envs = Utils.concatAll(platformEnvironmentPaths, environmentPaths);
        for (var i = 0; i < envs.length; ++i) {
            var value = qbs.getenv(envs[i]) || '';
            if (value.length > 0)
                _paths = _paths.concat(value.split(qbs.pathListSeparator));
        }
        var _suffixes = Utils.concatAll('', pathSuffixes);
        for (i = 0; i < _names.length; ++i) {
            for (var j = 0; j < _paths.length; ++j) {
                for (var k = 0; k < _suffixes.length; ++k) {
                    var _filePath = FileInfo.joinPaths(_paths[j], _suffixes[k], _names[i]);
                    if (File.exists(_filePath)) {
                        found = true;
                        path = FileInfo.joinPaths(_paths[j], _suffixes[k]);
                        filePath = _filePath;
                        fileName = _names[i];
                        return;
                    }
                }
            }
        }
        found = false;
        path = undefined;
        filePath = undefined;
        fileName = undefined;
    }
}
<commit_msg>Fix casing error in FileInfo import in PathProbe.<commit_after>import qbs 1.0
import qbs.File
import qbs.FileInfo
import "utils.js" as Utils

Probe {
    // Inputs
    property stringList names
    property var nameFilter
    property pathList pathPrefixes
    property stringList pathSuffixes
    property pathList platformPaths: [ '/usr', '/usr/local' ]
    property pathList environmentPaths
    property pathList platformEnvironmentPaths

    // Output
    property string path
    property string filePath
    property string fileName

    configure: {
        if (!names)
            throw '"names" must be specified';
        var _names = Utils.concatAll(names);
        if (nameFilter)
            _names = _names.map(nameFilter);
        // FIXME: Suggest how to obtain paths from system
        var _paths = Utils.concatAll(pathPrefixes, platformPaths);
        // FIXME: Add getenv support
        var envs = Utils.concatAll(platformEnvironmentPaths, environmentPaths);
        for (var i = 0; i < envs.length; ++i) {
            var value = qbs.getenv(envs[i]) || '';
            if (value.length > 0)
                _paths = _paths.concat(value.split(qbs.pathListSeparator));
        }
        var _suffixes = Utils.concatAll('', pathSuffixes);
        for (i = 0; i < _names.length; ++i) {
            for (var j = 0; j < _paths.length; ++j) {
                for (var k = 0; k < _suffixes.length; ++k) {
                    var _filePath = FileInfo.joinPaths(_paths[j], _suffixes[k], _names[i]);
                    if (File.exists(_filePath)) {
                        found = true;
                        path = FileInfo.joinPaths(_paths[j], _suffixes[k]);
                        filePath = _filePath;
                        fileName = _names[i];
                        return;
                    }
                }
            }
        }
        found = false;
        path = undefined;
        filePath = undefined;
        fileName = undefined;
    }
}

{'fraction_non_alphanumeric': 0.09704533876719307, 'fraction_numerical': 0.003565970453387672, 'mean_word_length': 1.7442348008385744, 'pattern_counts': {'":': 0, '<': 11, '<?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': '2546834', 'n_tokens_mistral': 1110, 'n_tokens_neox': 1072, 'n_words': 297}