query

package
v0.0.0-...-0dfd57a Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Modes = map[string]string{
	"where":   "select",
	"with":    "select",
	"sort":    "sort",
	"sorted":  "sort",
	"order":   "sort",
	"ordered": "sort",
	"group":   "group",
	"grouped": "group",
}
View Source
var Operators = map[string]string{
	"=":  "=",
	"==": "==",
	"!=": "!=",
	">":  ">",
	"<":  "<",
	">=": ">=",
	"<=": "<=",
	"^":  "^",
	"$":  "$",

	"equal":    "==",
	"like":     "==",
	"not":      "!",
	"over":     ">=",
	"greater":  ">=",
	"after":    ">=",
	"lower":    "<",
	"before":   "<",
	"start":    "^",
	"starts":   "^",
	"starting": "^",
	"end":      "$",
	"ends":     "$",
	"ending":   "$",
}
View Source
var Projections = map[string]string{
	"select": "list",
	"which":  "list",
	"what":   "list",
	"who":    "list",
	"where":  "list",
	"show":   "list",
	"find":   "list",
	"list":   "list",
	"how":    "count",
	"many":   "count",
	"count":  "count",
}
View Source
var Skipped = map[string]bool{
	"with": true,
	"than": true,
	"in":   true,
	"to":   true,
}

Functions

This section is empty.

Types

type Meaning

type Meaning struct {
	Predicate  string
	Object     string
	Selections map[string]interface{}
}

func (Meaning) String

func (m Meaning) String() string

type Parser

type Parser struct {
	KnownObjects map[string]string
	// contains filtered or unexported fields
}

func NewParser

func NewParser() *Parser

func (*Parser) IsObjectKnown

func (p *Parser) IsObjectKnown(object string) bool

func (*Parser) Parse

func (p *Parser) Parse(ctx *natural.Context) (*natural.ParseResult, error)

func (*Parser) RegisterObject

func (p *Parser) RegisterObject(object, action string)

Jump to

Keyboard shortcuts

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