service

package
v0.0.0-...-42a358f Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartWebServer

func StartWebServer(data *Data) error

StartWebServer starts the HTTP service and listens for the requests

Types

type Data

type Data struct {
	Tagger    Tagger
	Segmenter Segmenter
	Port      int
}

Data is service operation data

type ResultWord

type ResultWord struct {
	Type   string `json:"type"`
	String string `json:"string,omitempty"`
	Mi     string `json:"mi,omitempty"`
	Lemma  string `json:"lemma,omitempty"`
}

ResultWord is service output

func MapRes

func MapRes(text string, tgr *api.TaggerResult, sgm *api.SegmenterResult) ([]ResultWord, error)

MapRes map function

type Segmenter

type Segmenter interface {
	Process(text string) (*api.SegmenterResult, error)
}

Segmenter segments text

type Tagger

type Tagger interface {
	Process(string, *api.SegmenterResult) (*api.TaggerResult, error)
}

Tagger returns word forms

Jump to

Keyboard shortcuts

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