d

package module
v0.0.0-...-150b00c Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 17 Imported by: 2

README

An updateable dict service

d is an updateable dict service suitable for NLP tasks. Originally, it is used for the DictTagger of ling(A Natural Language Processing Toolkit in Golang).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dictionary

type Dictionary struct {
	Name string
	// contains filtered or unexported fields
}

func Build

func Build(src, dst string) (*Dictionary, error)

func Load

func Load(name string) (*Dictionary, error)

func (*Dictionary) Delete

func (d *Dictionary) Delete(k string) error

func (*Dictionary) Dump

func (d *Dictionary) Dump(path string) error

func (*Dictionary) Get

func (d *Dictionary) Get(key string) (map[string]interface{}, error)

func (*Dictionary) GetHandler

func (d *Dictionary) GetHandler(w http.ResponseWriter, r *http.Request)

func (*Dictionary) MultiMatch

func (d *Dictionary) MultiMatch(text string) (map[string]*Matches, error)

func (*Dictionary) MultiMatchHandler

func (d *Dictionary) MultiMatchHandler(w http.ResponseWriter, r *http.Request)

func (*Dictionary) MultiMaxMatch

func (d *Dictionary) MultiMaxMatch(text string) (map[string]*Matches, error)

func (*Dictionary) MultiMaxMatchHandler

func (d *Dictionary) MultiMaxMatchHandler(w http.ResponseWriter, r *http.Request)

func (*Dictionary) PrefixMatch

func (d *Dictionary) PrefixMatch(text string) (
	map[string]map[string]interface{}, error)

func (*Dictionary) PrefixMatchHandler

func (d *Dictionary) PrefixMatchHandler(w http.ResponseWriter, r *http.Request)

func (*Dictionary) RegisterWeb

func (d *Dictionary) RegisterWeb()

func (*Dictionary) Replace

func (d *Dictionary) Replace(k string, values map[string]interface{}) error

func (*Dictionary) Save

func (d *Dictionary) Save() error

func (*Dictionary) Update

func (d *Dictionary) Update(k string, values map[string]interface{}) error

func (*Dictionary) UpdateHandler

func (d *Dictionary) UpdateHandler(w http.ResponseWriter, r *http.Request)

type Matches

type Matches struct {
	Value map[string]interface{} `json:"value"`
	Hits  []*Pos                 `json:"hits"`
}

type Pos

type Pos struct {
	Start int `json:"start"`
	End   int `json:"end"`
}

type Record

type Record struct {
	K string                 `json:"k"`
	V map[string]interface{} `json:"v"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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