parser

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 10 Imported by: 2

Documentation

Overview

Package parser converts brevity requests from natural language into structured forms.

Index

Constants

View Source
const Anyface string = "anyface"

Anyface is a brevity codeword that can be used in place of a GCI callsign.

Variables

This section is empty.

Functions

func ParsePilotCallsign

func ParsePilotCallsign(tx string) (callsign string, isValid bool)

ParsePilotCallsign attempts to parse a callsign in one of the following formats:

  • A single word, followed by a number consisting of any digits
  • A number consisting of up to 3 digits

Garbage in between the digits is ignored. The result is normalized so that each digit is lowercase and space-delimited.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser converts brevity requests from natural language into structured forms.

func New

func New(callsign string, enableTextLogging bool) *Parser

New creates a new parser.

func (*Parser) Parse

func (p *Parser) Parse(tx string) any

Parse reads natural language text, checks if it starts with the GCI callsign, and attempts to parse a request from the text. Returns a brevity request, or nil if the text does not start with the GCI callsign.

Jump to

Keyboard shortcuts

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