<commit_before>noflo = require 'noflo'

class ParseJson extends noflo.Component
    constructor: ->
        @inPorts =
            in: new noflo.Port()
        @outPorts =
            out: new noflo.Port()

        @inPorts.in.on "data", (data) =>
            @outPorts.out.send JSON.parse data
        @inPorts.in.on "disconnect", =>
            @outPorts.out.disconnect()

exports.getComponent = -> new ParseJson<commit_msg>Added group forwarding<commit_after>noflo = require 'noflo'

class ParseJson extends noflo.Component
    constructor: ->
        @inPorts =
            in: new noflo.Port()
        @outPorts =
            out: new noflo.Port()

        @inPorts.in.on "begingroup", (group) =>
            @outPorts.out.beginGroup group
        @inPorts.in.on "data", (data) =>
            @outPorts.out.send JSON.parse data
        @inPorts.in.on "endgroup", () =>
            @outPorts.out.endGroup()
        @inPorts.in.on "disconnect", =>
            @outPorts.out.disconnect()

exports.getComponent = -> new ParseJson
{'fraction_non_alphanumeric': 0.13009708737864079, 'fraction_numerical': 0.0, 'mean_word_length': 2.068452380952381, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '7225867', 'n_tokens_mistral': 344, 'n_tokens_neox': 333, 'n_words': 65}