• Match a raw delivery label to a mood.

    Matching is keyword-based and deliberately lossy: the label space is open-ended, so an unrecognized label resolves to fallback rather than a wrong guess.

    Parameters

    • label: string

      The raw delivery label, as the provider wrote it.

    • fallback: null | AgentMood = DEFAULT_MOOD

      Mood to return when nothing matches. Pass null to handle the miss yourself. Defaults to DEFAULT_MOOD.

    Returns null | AgentMood

    Example

    matchMood('soft, with genuine care'); // 'empathetic'
    matchMood('like a pirate'); // 'calm'