snippets

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extensions

type Extensions []string

Extensions is used to tokenize snippets in directories using the list of file extensions.

func (Extensions) ReadLines added in v0.0.9

func (e Extensions) ReadLines(dirs ...string) apoco.StreamFunc

ReadLines returns a stream function that reads snippet files (identyfied by the given file extensions) and returns a stream of line tokens.

If a extension ends with `.txt`, one line is read from the text file (no confidences); if the file ends with `.json`, calamari's extended data format is assumed. Otherwise the file is read as a TSV file expecting one char and its confidence on each line.

func (Extensions) TokenizeLines added in v0.0.9

func (e Extensions) TokenizeLines(ctx context.Context, in <-chan apoco.Token, out chan<- apoco.Token) error

TokenizeLines is a stream function that tokenizes and aligns line tokens.

Jump to

Keyboard shortcuts

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