parser

package
v0.0.0-...-03c8f45 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const Anyface string = "anyface"

Variables

This section is empty.

Functions

func IsSimilar

func IsSimilar(a, b string) bool

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 interface {
	// 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.
	Parse(string) any
}

func New

func New(callsign string, enableTextLogging bool) Parser

Jump to

Keyboard shortcuts

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