builder

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package builder implements the dictionary builder.

Index

Constants

View Source
const MaxInt16 = 1<<15 - 1

MaxInt16 represents the int16 limit value.

Variables

This section is empty.

Functions

func Build

func Build(c *Config) (*dict.Dict, error)

Build builds a dictionary.

Types

type CharClassDef

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

CharClassDef represents char.def.

type Config

type Config struct {
	MatrixDefFileName string
	CharDefFileName   string
	UnkDefFileName    string
	// contains filtered or unexported fields
}

Config represents the configuration of dictionary builder.

func NewConfig

func NewConfig(path string, other []string, enc encoding.Encoding, info *MorphRecordInfo, unk *UnkRecordInfo) *Config

NewConfig creates a configuration for dictionary builder.

type MatrixDef

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

MatrixDef represents matrix.def.

type MorphRecordInfo

type MorphRecordInfo struct {
	ColSize                 int
	SurfaceIndex            int
	LeftIDIndex             int
	RightIDIndex            int
	WeightIndex             int
	POSStartIndex           int
	OtherContentsStartIndex int

	// extra info.
	Meta map[string]int8
}

MorphRecordInfo represents a format of CSV records.

type Record

type Record []string

Record represents a record of CSV.

type Records

type Records []Record

Records represents records of CSV.

func (Records) Len

func (p Records) Len() int

func (Records) Less

func (p Records) Less(i, j int) bool

func (Records) Swap

func (p Records) Swap(i, j int)

type UnkRecordInfo

type UnkRecordInfo struct {
	ColSize                 int
	CategoryIndex           int
	LeftIDIndex             int
	RightIndex              int
	WeigthIndex             int
	POSStartIndex           int
	OtherContentsStartIndex int
}

UnkRecordInfo represents a format of unk CSV records.

Jump to

Keyboard shortcuts

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