ja

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

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

Filter represents a japanese token filter.

func NewFilter

func NewFilter(opts ...FilterOption) (*Filter, error)

NewFilter returns a filter with the settings commonly used in lucene. To customize, set the options and overwrite the filter.

func (Filter) Drop

func (f Filter) Drop(tokens *[]tokenizer.Token)

Drop drops a token given the provided match function (stop-tags and stop-words).

func (Filter) Yield

func (f Filter) Yield(tokens []tokenizer.Token) []string

Yield returns a filtered word sequence from a token sequence.

type FilterOption

type FilterOption func(*Filter)

FilterOption represents an option of the japanese token filter.

func BaseFormFilterOption

func BaseFormFilterOption(p []filter.POS) FilterOption

BaseFormFilterOption returns a base form filter option.

func StopTagsFilterOption

func StopTagsFilterOption(p []filter.POS) FilterOption

StopTagsFilterOption returns a stop tags filter option.

func StopWordsFilterOption

func StopWordsFilterOption(p []string) FilterOption

StopWordsFilterOption returns a stop words filter option.

Jump to

Keyboard shortcuts

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