Class PhraseLibrary
Manages the mapping from step operations to Gherkin phrase templates. Ships a built-in default set; project-level overrides are loaded from .cress/phrases.yaml when present.
public sealed class PhraseLibrary
- Inheritance
-
PhraseLibrary
- Inherited Members
Methods
CreateDefault()
Build the library from the embedded defaults only.
public static PhraseLibrary CreateDefault()
Returns
CreateWithOverrides(string)
Build the library from the embedded defaults, then merge any overrides
found at overrideYamlPath.
public static PhraseLibrary CreateWithOverrides(string overrideYamlPath)
Parameters
overrideYamlPathstring
Returns
Expand(StepPhrase, IReadOnlyDictionary<string, string>)
Expand a phrase template using the step's with-block values.
public static string Expand(StepPhrase phrase, IReadOnlyDictionary<string, string> withBlock)
Parameters
phraseStepPhrasewithBlockIReadOnlyDictionary<string, string>
Returns
GetAllPhrases()
Returns every phrase in the library (used by the ingester for reverse-lookup).
public IReadOnlyList<StepPhrase> GetAllPhrases()
Returns
Resolve(string, IReadOnlyDictionary<string, string>)
Resolve the best-matching phrase for a given step name and with-block keys. Priority: phrase with the most RequiredKeys that are all satisfied wins. Returns null if no phrase is registered for the step.
public StepPhrase? Resolve(string stepOp, IReadOnlyDictionary<string, string> withBlock)
Parameters
stepOpstringwithBlockIReadOnlyDictionary<string, string>