glossa

package module
v0.0.0-...-df76a78 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 5 Imported by: 1

README

glossa

Go Report Card

glossa is the greek word for language. The goal of this language is to help chat ops systems take a string that specifies a set of keywords and variables and translate that into a regular expression with capture groups that corersponds to the specification. I wrote this to help with two related applications. One was a Slack bot where I wanted the ability to change variables within the bot and the other was to parse through text that had been converted from speech and respond to commands.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Glossa

type Glossa interface {
	Parse(command string) (Pattern, error)
}

func NewParser

func NewParser() (Glossa, error)

type Pattern

type Pattern interface {
	Match(string) (bool, []interface{}, error)
	GetCommand() string
	GetTokens() []*lexmachine.Token
	GetRegexStr() string
	GetRe() *regexp.Regexp
}

func NewPattern

func NewPattern(command string, regexStr string, tokens []*lexmachine.Token) Pattern

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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