Example #1
0
        public void processSocKitMessage(TurKitSocKit.TurKitHumanMacroResult message)
        {
            messages.Add(message);
            postProcessSocKitMessage(message);

            /*
             * Patch patch = patches[message.input];
             * if (patch.replacements.Count == 0)
             * {
             *  foreach (string replacement in message.alternatives)
             *  {
             *      if (this.separator == Separator.Sentence)
             *      {
             *          patch.replacements.Add(replacement + spacesBetweenSentences);
             *      }
             *      else
             *      {
             *          patch.replacements.Add(replacement);
             *      }
             *  }
             *  numberReturned++;
             * }
             *
             * if (numberReturned == patches.Count)
             * {
             *  this.tk.turkitLoopTimer.Dispose();
             *  Globals.Soylent.soylentMap[Globals.Soylent.jobToDoc[this.job]].Invoke(new resultsBackDelegate(this.resultsBack), new object[] { });
             * }
             */
        }
Example #2
0
        public void postProcessSocKitMessage(TurKitSocKit.TurKitHumanMacroResult message)
        {
            prepareRanges();

            Patch patch = patches[message.input];

            if (patch.replacements.Count == 0)
            {
                foreach (string replacement in message.alternatives)
                {
                    if (this.separator == Separator.Sentence)
                    {
                        patch.replacements.Add(replacement + spacesBetweenSentences);
                    }
                    else
                    {
                        patch.replacements.Add(replacement);
                    }
                }
            }
            numberReturned++;

            if (numberReturned == patches.Count)
            {
                if (this.tk.turkitLoopTimer != null)
                {
                    this.tk.turkitLoopTimer.Dispose();
                }
                this.jobDone = true;

                Globals.Soylent.soylentMap[Globals.Soylent.jobToDoc[this.job]].Invoke(new resultsBackDelegate(this.resultsBack), new object[] { });
            }
        }