<commit_before>class Fbp
    matchPort: new RegExp "([A-Z]+)"
    matchComponent: new RegExp "([A-Za-z]+)\\(([A-Za-z\/]+|)\\)"
    matchInitial: new RegExp "\'(.+)\'"
    matchConnection: new RegExp "\-\>"
    matchSeparator: new RegExp "[\\s,\\n]"

    constructor: ->
        @currentNode = {}
        @currentEdge = {}
        @nodes = {}
        @edges = []

    parse: (string) ->
        currentString = ""
        for char, index in string
            checkTerminator = @matchSeparator.exec(char)
            currentString += char unless checkTerminator
            continue unless checkTerminator or index is string.length - 1

            connection = @matchConnection.exec currentString
            if connection
                @handleConnection connection
                currentString = ""
            initial = @matchInitial currentString
            if initial
                @handleInitial initial
                currentString = ""
            component = @matchComponent currentString
            if component
                @handleComponent component
                currentString = ""
            port = @matchPort currentString
            if port
                @handlePort port
                currentString = ""

        json =
            properties: 
                name: ""
            processes: @nodes
            connections: @edges

    handleConnection: ->
        @currentEdge.src.process = @currentNode.name if @currentNode.name

    handleInitial: (initial) ->
        @currentNode =<commit_msg>Comments support<commit_after>class Fbp
    matchPort: new RegExp "([A-Z]+)"
    matchComponent: new RegExp "([A-Za-z]+)\\(([A-Za-z\/]+|)\\)"
    matchInitial: new RegExp "\'(.+)\'"
    matchConnection: new RegExp "\-\>"
    matchSeparator: new RegExp "[\\s,\\n]"

    constructor: ->
        @lastElement = null
        @currentNode = {}
        @currentEdge = {}
        @nodes = {}
        @edges = []

    parse: (string) ->
        currentString = ""
        for char, index in string

            # Commenting support. Ignore everything from # to newline
            if char is '#'
                @lastElement = "comment"
                continue
            if @lastElement is "comment"
                if char is "\n"
                    @lastElement = null
                continue

            checkTerminator = @matchSeparator.exec(char)
            currentString += char unless checkTerminator
            continue unless checkTerminator or index is string.length - 1

            connection = @matchConnection.exec currentString
            if connection
                @lastElement = "connection"
                @handleConnection connection
                currentString = ""
            initial = @matchInitial currentString
            if initial
                @lastElement = "initial"
                @handleInitial initial
                currentString = ""
            component = @matchComponent currentString
            if component
                @lastElement = "component"
                @handleComponent component
                currentString = ""
            port = @matchPort currentString
            if port
                @lastElement = "port"
                @handlePort port
                currentString = ""

        json =
            properties: 
                name: ""
            processes: @nodes
            connections: @edges

    handleConnection: ->
        @currentEdge.src.process = @currentNode.name if @currentNode.name

    handleInitial: (initial) ->
        @currentNode =
{'fraction_non_alphanumeric': 0.09697309417040359, 'fraction_numerical': 0.0005605381165919282, 'mean_word_length': 1.5169252468265162, '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': '1830920', 'n_tokens_mistral': 871, 'n_tokens_neox': 822, 'n_words': 223}