composer

package
v0.2.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

package composer converts brevity responses from structured forms into natural language.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PronounceBearing

func PronounceBearing(bearing bearings.Bearing) (s string)

PronounceBearing composes a text representation ofbearing.

func PronounceDecimal

func PronounceDecimal(f float64, precision int, separator string) string

PronounceFractional composes a text representation of the given float as a sequence of digits.

func PronounceInt

func PronounceInt(d int) string

PronounceInt composes a text representation of a a sequence of digits, using aviation pronunciation. 4 is pronounced "fower", 8 is pronounced "ait", and 9 is pronounced "niner".

func PronounceNumbers

func PronounceNumbers(s string) string

PronounceNumbers composes a text representation of the digits in the given string as a sequence of digits. Non-digit characters are ignored.

Types

type Composer

type Composer interface {
	// ComposeAlphaCheckResponse constructs natural language brevity for responding to an ALPHA CHECK.
	ComposeAlphaCheckResponse(brevity.AlphaCheckResponse) NaturalLanguageResponse
	// ComposeBogeyDopeResponse constructs natural language brevity for responding to a BOGEY DOPE call.
	ComposeBogeyDopeResponse(brevity.BogeyDopeResponse) NaturalLanguageResponse
	// ComposeDeclareResponse constructs natural language brevity for responding to a DECLARE call.
	ComposeDeclareResponse(brevity.DeclareResponse) NaturalLanguageResponse
	// ComposeFadedCall constructs natural language brevity for announcing a contact has faded.
	ComposeFadedCall(brevity.FadedCall) NaturalLanguageResponse
	// ComposeNegativeRadarContactResponse constructs natural language brevity for saying the controller cannot find a contact on the radar.
	ComposeNegativeRadarContactResponse(brevity.NegativeRadarContactResponse) NaturalLanguageResponse
	// ComposePictureResponse constructs natural language brevity for responding to a PICTURE call.
	ComposePictureResponse(brevity.PictureResponse) NaturalLanguageResponse
	// ComposeRaygunResponse constructs natural language brevity for responding to a RADIO CHECK.
	ComposeRadioCheckResponse(brevity.RadioCheckResponse) NaturalLanguageResponse
	// ComposeSnaplockResponse constructs natural language brevity for responding to a SNAPLOCK call.
	ComposeSnaplockResponse(brevity.SnaplockResponse) NaturalLanguageResponse
	// ComposeSpikedResponse constructs natural language brevity for responding to a SPIKED call.
	ComposeSpikedResponse(brevity.SpikedResponse) NaturalLanguageResponse
	// ComposeSunriseCall constructs natural language brevity for announcing GCI services are online.
	ComposeSunriseCall(brevity.SunriseCall) NaturalLanguageResponse
	// ComposeThreatCall constructs natural language brevity for announcing a threat.
	ComposeThreatCall(brevity.ThreatCall) NaturalLanguageResponse
	// ComposeSayAgainResponse constructs natural language brevity for asking a caller to repeat their last transmission.
	ComposeSayAgainResponse(brevity.SayAgainResponse) NaturalLanguageResponse
	// ComposeTripwireResponse constructs natural language brevity for educating a caller about threat monitoring.
	ComposeTripwireResponse(brevity.TripwireResponse) NaturalLanguageResponse
}

Composer converts brevity responses from structured forms into natural language. It is nondeterministic; the same input may randomly produce different output, to add variety and personality to the bot's respones.

func New

func New(callsign string) Composer

type NaturalLanguageResponse

type NaturalLanguageResponse struct {
	// Subtitle is how the response will be displayed as in-game text.
	Subtitle string
	// Speech is the input to the TTS provider.
	Speech string
}

NaturalLanguageResponse contains the composer's responses in text form.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL