Table of Contents

Class PhraseLibrary

Namespace
Cress.Gherkin.Phrases
Assembly
Cress.Gherkin.dll

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

PhraseLibrary

CreateWithOverrides(string)

Build the library from the embedded defaults, then merge any overrides found at overrideYamlPath.

public static PhraseLibrary CreateWithOverrides(string overrideYamlPath)

Parameters

overrideYamlPath string

Returns

PhraseLibrary

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

phrase StepPhrase
withBlock IReadOnlyDictionary<string, string>

Returns

string

GetAllPhrases()

Returns every phrase in the library (used by the ingester for reverse-lookup).

public IReadOnlyList<StepPhrase> GetAllPhrases()

Returns

IReadOnlyList<StepPhrase>

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

stepOp string
withBlock IReadOnlyDictionary<string, string>

Returns

StepPhrase