Documentation ¶
Overview ¶
Package composer converts brevity responses from structured forms into natural language.
Index ¶
- type Composer
- func (c *Composer) ComposeAlphaCheckResponse(response brevity.AlphaCheckResponse) NaturalLanguageResponse
- func (c *Composer) ComposeBogeyDopeResponse(response brevity.BogeyDopeResponse) NaturalLanguageResponse
- func (c *Composer) ComposeCheckInResponse(response brevity.CheckInResponse) NaturalLanguageResponse
- func (c *Composer) ComposeDeclareResponse(response brevity.DeclareResponse) NaturalLanguageResponse
- func (c *Composer) ComposeFadedCall(call brevity.FadedCall) (response NaturalLanguageResponse)
- func (c *Composer) ComposeMergedCall(call brevity.MergedCall) NaturalLanguageResponse
- func (c *Composer) ComposeNegativeRadarContactResponse(response brevity.NegativeRadarContactResponse) NaturalLanguageResponse
- func (c *Composer) ComposePictureResponse(response brevity.PictureResponse) NaturalLanguageResponse
- func (c *Composer) ComposeRadioCheckResponse(response brevity.RadioCheckResponse) NaturalLanguageResponse
- func (c *Composer) ComposeSayAgainResponse(response brevity.SayAgainResponse) NaturalLanguageResponse
- func (c *Composer) ComposeShoppingResponse(r brevity.ShoppingResponse) NaturalLanguageResponse
- func (c *Composer) ComposeSnaplockResponse(response brevity.SnaplockResponse) NaturalLanguageResponse
- func (c *Composer) ComposeSpikedResponse(response brevity.SpikedResponse) NaturalLanguageResponse
- func (c *Composer) ComposeSunriseCall(call brevity.SunriseCall) NaturalLanguageResponse
- func (c *Composer) ComposeThreatCall(call brevity.ThreatCall) NaturalLanguageResponse
- func (c *Composer) ComposeTripwireResponse(response brevity.TripwireResponse) NaturalLanguageResponse
- type NaturalLanguageResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Composer ¶
type Composer struct { // Callsign of the GCI controller Callsign string }
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 responses.
func (*Composer) ComposeAlphaCheckResponse ¶
func (c *Composer) ComposeAlphaCheckResponse(response brevity.AlphaCheckResponse) NaturalLanguageResponse
ComposeAlphaCheckResponse constructs natural language brevity for responding to an ALPHA CHECK.
func (*Composer) ComposeBogeyDopeResponse ¶
func (c *Composer) ComposeBogeyDopeResponse(response brevity.BogeyDopeResponse) NaturalLanguageResponse
ComposeBogeyDopeResponse constructs natural language brevity for responding to a BOGEY DOPE call.
func (*Composer) ComposeCheckInResponse ¶ added in v0.12.0
func (c *Composer) ComposeCheckInResponse(response brevity.CheckInResponse) NaturalLanguageResponse
ComposeCheckInResponse constructs natural language brevity for responding to an ambiguous CHECK IN call.
func (*Composer) ComposeDeclareResponse ¶
func (c *Composer) ComposeDeclareResponse(response brevity.DeclareResponse) NaturalLanguageResponse
ComposeDeclareResponse constructs natural language brevity for responding to a DECLARE call.
func (*Composer) ComposeFadedCall ¶
func (c *Composer) ComposeFadedCall(call brevity.FadedCall) (response NaturalLanguageResponse)
ComposeFadedCall constructs natural language brevity for announcing a contact has faded.
func (*Composer) ComposeMergedCall ¶ added in v0.4.0
func (c *Composer) ComposeMergedCall(call brevity.MergedCall) NaturalLanguageResponse
ComposeMergedCall constructs natural language brevity for announcing a merge.
func (*Composer) ComposeNegativeRadarContactResponse ¶
func (c *Composer) ComposeNegativeRadarContactResponse(response brevity.NegativeRadarContactResponse) NaturalLanguageResponse
ComposeNegativeRadarContactResponse constructs natural language brevity for saying the controller cannot find a contact on the radar.
func (*Composer) ComposePictureResponse ¶
func (c *Composer) ComposePictureResponse(response brevity.PictureResponse) NaturalLanguageResponse
ComposePictureResponse constructs natural language brevity for responding to a PICTURE call.
func (*Composer) ComposeRadioCheckResponse ¶
func (c *Composer) ComposeRadioCheckResponse(response brevity.RadioCheckResponse) NaturalLanguageResponse
ComposeRadioCheckResponse constructs natural language brevity for responding to a RADIO CHECK.
func (*Composer) ComposeSayAgainResponse ¶
func (c *Composer) ComposeSayAgainResponse(response brevity.SayAgainResponse) NaturalLanguageResponse
ComposeSayAgainResponse constructs natural language brevity for asking a caller to repeat their last transmission.
func (*Composer) ComposeShoppingResponse ¶ added in v0.10.0
func (c *Composer) ComposeShoppingResponse(r brevity.ShoppingResponse) NaturalLanguageResponse
ComposeShoppingResponse constructs natural language brevity for educating a caller about SHOPPING brevity.
func (*Composer) ComposeSnaplockResponse ¶
func (c *Composer) ComposeSnaplockResponse(response brevity.SnaplockResponse) NaturalLanguageResponse
ComposeSnaplockResponse constructs natural language brevity for responding to a SNAPLOCK call.
func (*Composer) ComposeSpikedResponse ¶
func (c *Composer) ComposeSpikedResponse(response brevity.SpikedResponse) NaturalLanguageResponse
ComposeSpikedResponse constructs natural language brevity for responding to a SPIKED call.
func (*Composer) ComposeSunriseCall ¶
func (c *Composer) ComposeSunriseCall(call brevity.SunriseCall) NaturalLanguageResponse
ComposeSunriseCall constructs natural language brevity for announcing GCI services are online.
func (*Composer) ComposeThreatCall ¶
func (c *Composer) ComposeThreatCall(call brevity.ThreatCall) NaturalLanguageResponse
ComposeThreatCall constructs natural language brevity for announcing a threat.
func (*Composer) ComposeTripwireResponse ¶
func (c *Composer) ComposeTripwireResponse(response brevity.TripwireResponse) NaturalLanguageResponse
ComposeTripwireResponse constructs natural language brevity for educating a caller about threat monitoring.
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.
func (*NaturalLanguageResponse) Write ¶ added in v0.13.2
func (r *NaturalLanguageResponse) Write(speech, subtitle string)
Write appends text to the subtitle and speech fields.
func (*NaturalLanguageResponse) WriteBoth ¶ added in v0.13.2
func (r *NaturalLanguageResponse) WriteBoth(s string)
WriteBoth appends the same text to the subtitle and speech fields.
func (*NaturalLanguageResponse) WriteResponse ¶ added in v0.13.2
func (r *NaturalLanguageResponse) WriteResponse(response NaturalLanguageResponse)
WriteResponse appends the given response's subtitle and speech to this response.