Package dev.dokimos.core.evaluators
Class LengthEvaluator.Builder
java.lang.Object
dev.dokimos.core.evaluators.LengthEvaluator.Builder
- Enclosing class:
LengthEvaluator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the evaluator.evaluationParams(List<EvalTestCaseParam> evaluationParams) Sets which test case parameters to evaluate.maximumOutputLength(int maximumOutputLength) Sets the maximum allowed output length (inclusive).minimumOutputLength(int minimumOutputLength) Sets the minimum allowed output length (inclusive).Sets the evaluator name.threshold(double threshold) Sets the minimum score threshold for success.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Sets the evaluator name.- Parameters:
name- the evaluator name- Returns:
- this builder
-
threshold
Sets the minimum score threshold for success.- Parameters:
threshold- the threshold value- Returns:
- this builder
-
evaluationParams
Sets which test case parameters to evaluate.- Parameters:
evaluationParams- the parameters to evaluate- Returns:
- this builder
-
maximumOutputLength
Sets the maximum allowed output length (inclusive). Required.- Parameters:
maximumOutputLength- the maximum length in code points, at least 1- Returns:
- this builder
-
minimumOutputLength
Sets the minimum allowed output length (inclusive). Defaults to 0.- Parameters:
minimumOutputLength- the minimum length in code points, at least 0- Returns:
- this builder
-
build
Builds the evaluator.- Returns:
- a new length evaluator
- Throws:
IllegalStateException- if the maximum length is missing or less than 1, the minimum length is negative, or the minimum length exceeds the maximum length
-