Record Class NegativeExample
java.lang.Object
java.lang.Record
org.ek9lang.assist.NegativeExample
- Record Components:
sourceFile- The relative path of the source .ek9 filepattern- The error pattern name (e.g., "constrained-type-not-compatible")category- The error category (e.g., "bad-generic-constraint-use")corpus- The source corpus ("parseButFailCompile" or "fuzzCorpus")purpose- Description of what this example demonstrateswhyItFails- Explanation of why the code fails to compileerrors- List of compiler errors this example triggershowToFix- Suggested fixes for the errorvalidPatterns- Valid alternative patternskeyConcepts- Key concepts demonstrated by this examplelanguageComparisons- How other languages handle this differentlystrippedCode- Code body with all directive lines removed
public record NegativeExample(String sourceFile, String pattern, String category, String corpus, String purpose, String whyItFails, List<ErrorInfo> errors, List<String> howToFix, List<String> validPatterns, List<String> keyConcepts, List<LanguageComparison> languageComparisons, String strippedCode)
extends Record
Holds a single negative training example from the EK9 test corpus.
Negative examples teach LLMs what incorrect EK9 looks like, why it fails,
and how to fix it. Sourced from parseButFailCompile and fuzzCorpus test files.
-
Constructor Summary
ConstructorsConstructorDescriptionNegativeExample(String sourceFile, String pattern, String category, String corpus, String purpose, String whyItFails, List<ErrorInfo> errors, List<String> howToFix, List<String> validPatterns, List<String> keyConcepts, List<LanguageComparison> languageComparisons, String strippedCode) Creates an instance of aNegativeExamplerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncategory()Returns the value of thecategoryrecord component.corpus()Returns the value of thecorpusrecord component.final booleanIndicates whether some other object is "equal to" this one.errors()Returns the value of theerrorsrecord component.final inthashCode()Returns a hash code value for this object.howToFix()Returns the value of thehowToFixrecord component.Returns the value of thekeyConceptsrecord component.Returns the value of thelanguageComparisonsrecord component.pattern()Returns the value of thepatternrecord component.purpose()Returns the value of thepurposerecord component.Returns the value of thesourceFilerecord component.Returns the value of thestrippedCoderecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevalidPatternsrecord component.Returns the value of thewhyItFailsrecord component.
-
Constructor Details
-
NegativeExample
public NegativeExample(String sourceFile, String pattern, String category, String corpus, String purpose, String whyItFails, List<ErrorInfo> errors, List<String> howToFix, List<String> validPatterns, List<String> keyConcepts, List<LanguageComparison> languageComparisons, String strippedCode) Creates an instance of aNegativeExamplerecord class.- Parameters:
sourceFile- the value for thesourceFilerecord componentpattern- the value for thepatternrecord componentcategory- the value for thecategoryrecord componentcorpus- the value for thecorpusrecord componentpurpose- the value for thepurposerecord componentwhyItFails- the value for thewhyItFailsrecord componenterrors- the value for theerrorsrecord componenthowToFix- the value for thehowToFixrecord componentvalidPatterns- the value for thevalidPatternsrecord componentkeyConcepts- the value for thekeyConceptsrecord componentlanguageComparisons- the value for thelanguageComparisonsrecord componentstrippedCode- the value for thestrippedCoderecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
sourceFile
Returns the value of thesourceFilerecord component.- Returns:
- the value of the
sourceFilerecord component
-
pattern
-
category
-
corpus
-
purpose
-
whyItFails
Returns the value of thewhyItFailsrecord component.- Returns:
- the value of the
whyItFailsrecord component
-
errors
-
howToFix
-
validPatterns
Returns the value of thevalidPatternsrecord component.- Returns:
- the value of the
validPatternsrecord component
-
keyConcepts
Returns the value of thekeyConceptsrecord component.- Returns:
- the value of the
keyConceptsrecord component
-
languageComparisons
Returns the value of thelanguageComparisonsrecord component.- Returns:
- the value of the
languageComparisonsrecord component
-
strippedCode
Returns the value of thestrippedCoderecord component.- Returns:
- the value of the
strippedCoderecord component
-