<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Conveyor_JSONRPC_API._2._4._1;
using Conveyor_JSONRPC_API._2._4._1.Types;

namespace RepRancher._2._4._1
{
    class ConveyorListenerParser
    {
        /*
         * Shared Resources Object
         */
        SharedResources SharedResources;
        /*
         * Tracks if parsing has failed due to incomplete command?
         */
        public bool previousParseFailure;

        public ConveyorListenerParser(SharedResources Shared_Resources)
        {
            SharedResources = Shared_Resources;
            previousParseFailure = false;
        }

        public void ListenerParserThreadRun()
        {
            int ProcessStalls = 0;
            while (true)
            {
                Console.Error.WriteLine(DateTime.Now.ToString() + ": Initializing Conveyor 2.4.1 ListenerParser");
                Console.Error.WriteLine();
                if (SharedResources.contentAvailable || ProcessStalls > 5)
                {
                    //Resets the number of Process Stalls
                    ProcessStalls = 0;

                    //Lock the Conveyor Reply String
                    SharedResources.ConveyorReplyMutex.WaitOne();
                    //Check to see if there is a command
                    //System.Console.WriteLine("Processor determining if there is a Complete JSON object");
                    //Processor determining if there is a Complete JSON object
                    string[] command = ContainsCompleteJSONObject(SharedResources.repliesFromConveyor);<commit_msg>Fixed placement of parser start update.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Conveyor_JSONRPC_API._2._4._1;
using Conveyor_JSONRPC_API._2._4._1.Types;

namespace RepRancher._2._4._1
{
    class ConveyorListenerParser
    {
        /*
         * Shared Resources Object
         */
        SharedResources SharedResources;
        /*
         * Tracks if parsing has failed due to incomplete command?
         */
        public bool previousParseFailure;

        public ConveyorListenerParser(SharedResources Shared_Resources)
        {
            SharedResources = Shared_Resources;
            previousParseFailure = false;
        }

        public void ListenerParserThreadRun()
        {
            int ProcessStalls = 0;
            Console.Error.WriteLine(DateTime.Now.ToString() + ": Initializing Conveyor 2.4.1 ListenerParser");
            Console.Error.WriteLine();
            while (true)
            {                
                if (SharedResources.contentAvailable || ProcessStalls > 5)
                {
                    //Resets the number of Process Stalls
                    ProcessStalls = 0;

                    //Lock the Conveyor Reply String
                    SharedResources.ConveyorReplyMutex.WaitOne();
                    //Check to see if there is a command
                    //System.Console.WriteLine("Processor determining if there is a Complete JSON object");
                    //Processor determining if there is a Complete JSON object
                    string[] command = ContainsCompleteJSONObject(SharedResources.repliesFromConveyor);
{'fraction_non_alphanumeric': 0.06963538553496712, 'fraction_numerical': 0.008965929468021518, 'mean_word_length': 1.8878343399482311, 'pattern_counts': {'":': 2, '<': 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': '7647852', 'n_tokens_mistral': 827, 'n_tokens_neox': 778, 'n_words': 210}