corpora

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GZipCorpusIterator

type GZipCorpusIterator struct {
	CorpusPath string
}

GZipCorpusIterator implements the TextCorpusIterator interface for gzip-compressed corpus files.

func NewGZipCorpusIterator

func NewGZipCorpusIterator(corpusPath string) *GZipCorpusIterator

NewGZipCorpusIterator returns a new GZipCorpusIterator.

func (*GZipCorpusIterator) ForEachLine

func (c *GZipCorpusIterator) ForEachLine(callback func(i int, text string))

ForEachLine calls the callback for each line of each regular file from the gzip archive.

type TextCorpusIterator

type TextCorpusIterator interface {
	// ForEachLine calls the callback for each line of a corpus.
	// The index of the first line is 1.
	ForEachLine(callback func(i int, line string))
}

TextCorpusIterator is implemented by any value that has the ForEachLine method.

Jump to

Keyboard shortcuts

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