autocomplete

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package autocomplete provides basic autocompletion functionality. It takes in a set of files and creates a completer based on all the file contents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Complete

func Complete(prefix string, corpora ...string) []string

func GetCommonPrefix

func GetCommonPrefix(matches []string) string

GetCommonPrefix looks for the longest common prefix of a set of strings.

func Suffixes

func Suffixes(tokens []string, prefix string, n int) []string

Suffixes returns the string suffix after the prefix.

func TokenMatch

func TokenMatch(tokens []string, prefix string, n int) []string

Types

type AutoComplete

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

func New

func New() *AutoComplete

func (*AutoComplete) Complete

func (ac *AutoComplete) Complete(prefix string, corpora ...string) []string

func (*AutoComplete) GetCommonPrefix

func (ac *AutoComplete) GetCommonPrefix(matches []string) string

Jump to

Keyboard shortcuts

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