protected override string PrettyPrintedExamples() { var formattedConstraints = UsedExamples.Select(SpecFileExampleFormat.FromExample); return(JsonConvert.SerializeObject(formattedConstraints, Formatting.Indented)); }
protected override string PrettyPrintedExamples() { var formattedConstraints = UsedExamples.Select(constraint => new Dictionary <string, string> { ["Input"] = constraint.InputMember.Value, ["Output"] = constraint.OutputMember.Value }); return(JsonConvert.SerializeObject(formattedConstraints, Formatting.Indented)); }
public override void Run() { if (!Directory.Exists(ReportDirPath)) { Directory.CreateDirectory(ReportDirPath); } Console.WriteLine($"Learning Extraction.Text sequence program for {SubBenchmarkName}"); while (!Success && TryGetNextExample(out SequenceExample nextConstraint)) { var session = new SequenceSession(); UsedExamples.Add(nextConstraint); session.Constraints.Add(UsedExamples); Program = session.Learn(); Success = Program != null && AllExamples.All(e => Valid(e, Program)); } RecordResult(); }
/// <summary> /// Pretty print used examples. /// </summary> /// <returns>Pretty-printed string containing examples used during learning.</returns> protected virtual string PrettyPrintedExamples() => string.Join(Environment.NewLine, UsedExamples.Select(c => c.ToString()));