<commit_before>/*
 * app/src/Program.js
 *
 *
 * Copyright (C) 2015  <NAME> <<EMAIL>>
 *
 * License in LICENSE file at the root of the repository.
 *
 */


function Program (ctx) {

    var getParameter = function (props, k, def) {
        return ctx.getProperty(props, 'params.'+k, def);
    };

    var startFeature = function (geom, props, fm) {
        var T = new ctx.Transform(fm);
        ctx.processStyle(props, T);
    };

    var endFeature = function () {
        ctx.emit('restore');
    };

    var textedLine = function (coordinates, props, fm) {
        var T = new ctx.Transform(fm);
        ctx.lineProject(coordinates);
        ctx.drawTextOnLine(T, coordinates,
            getParameter(props, 'text'),
            getParameter(props, 'fontsize'));
    };


    ctx.linestring = function (coordinates, props, fm) {
        startFeature(props, fm);
        var txt = getParameter(props, 'text');
        if (txt) {
            textedLine(coordinates, props, fm);
        }
        else {
            var T = new ctx.Transform(fm);
            ctx.lineProject(coordinates);
            ctx.lineTransform(T, coordinates);
            ctx.emit('draw', 'line', coordinates);
        }
        endFeature();
    };

    var hatchedPolygon = function (coordinates, props, fm) {<commit_msg>fixed #56<commit_after>/*
 * app/src/Program.js
 *
 *
 * Copyright (C) 2015  <NAME> <<EMAIL>>
 *
 * License in LICENSE file at the root of the repository.
 *
 */


function Program (ctx) {

    var getParameter = function (props, k, def) {
        return ctx.getProperty(props, 'params.'+k, def);
    };

    var startFeature = function (props, fm) {
        ctx.processStyle(props, new ctx.Transform(fm));
    };

    var endFeature = function () {
        ctx.emit('restore');
    };

    var textedLine = function (coordinates, props, fm) {
        var T = new ctx.Transform(fm);
        ctx.lineProject(coordinates);
        ctx.drawTextOnLine(T, coordinates,
            getParameter(props, 'text'),
            getParameter(props, 'fontsize'));
    };


    ctx.linestring = function (coordinates, props, fm) {
        startFeature(props, fm);
        var txt = getParameter(props, 'text');
        if (txt) {
            textedLine(coordinates, props, fm);
        }
        else {
            var T = new ctx.Transform(fm);
            ctx.lineProject(coordinates);
            ctx.lineTransform(T, coordinates);
            ctx.emit('draw', 'line', coordinates);
        }
        endFeature();
    };

    var hatchedPolygon = function (coordinates, props, fm) {
{'fraction_non_alphanumeric': 0.1352506801399145, 'fraction_numerical': 0.00388651379712398, 'mean_word_length': 2.1975155279503107, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1156076', 'n_tokens_mistral': 788, 'n_tokens_neox': 752, 'n_words': 191}