migemo

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareUtf16String

func CompareUtf16String(a []uint16, b []uint16) int

func ConvertHan2Zen

func ConvertHan2Zen(source string) string

func ConvertHira2Kata

func ConvertHira2Kata(source string) string

func ConvertZen2Han

func ConvertZen2Han(source string) string

func Query

func Query(word string, dict *CompactDictionary, operator *RegexOperator) string

func QueryAWord

func QueryAWord(word string, dict *CompactDictionary, operator *RegexOperator) string

Types

type BitList

type BitList struct {
	Words []uint64
	Size  int
}

func NewBitList

func NewBitList() *BitList

func NewBitListWithSize

func NewBitListWithSize(size int) *BitList

func (*BitList) Add

func (self *BitList) Add(value bool)

func (*BitList) Get

func (self *BitList) Get(pos int) bool

func (*BitList) Set

func (self *BitList) Set(pos int, value bool)

type BitVector

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

func NewBitVector

func NewBitVector(words []uint64, sizeInBits uint32) *BitVector

func (*BitVector) Get

func (this *BitVector) Get(pos uint32) bool

func (*BitVector) NextClearBit

func (this *BitVector) NextClearBit(fromIndex uint) uint

func (*BitVector) Rank

func (this *BitVector) Rank(pos uint, b bool) uint

func (*BitVector) Select

func (this *BitVector) Select(count uint32, b bool) uint

func (*BitVector) Size

func (this *BitVector) Size() int

type CompactDictionary

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

func BuildDictionaryFromMigemoDictFile

func BuildDictionaryFromMigemoDictFile(fp io.Reader) *CompactDictionary

func NewCompactDictionary

func NewCompactDictionary(buffer []uint8) *CompactDictionary

func (*CompactDictionary) GetMappingBitVector

func (this *CompactDictionary) GetMappingBitVector() *BitVector

func (*CompactDictionary) PredictiveSearch

func (this *CompactDictionary) PredictiveSearch(key []uint16, f func([]uint16))

func (*CompactDictionary) Save

func (this *CompactDictionary) Save(fp *os.File)

func (*CompactDictionary) Search

func (this *CompactDictionary) Search(key []uint16, f func([]uint16))

type KeyValuePair

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

type Level

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

func (*Level) Size

func (self *Level) Size() int

type LoudsTrie

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

func BuildLoudsTrie

func BuildLoudsTrie(keys [][]uint16) (*LoudsTrie, []uint32, error)

func NewLoudsTrie

func NewLoudsTrie(bitVector *BitVector, edges []uint16) *LoudsTrie

func (*LoudsTrie) FirstChild

func (this *LoudsTrie) FirstChild(x uint32) int

func (*LoudsTrie) Lookup

func (this *LoudsTrie) Lookup(key []uint16) int

func (*LoudsTrie) Parent

func (this *LoudsTrie) Parent(x uint32) uint32

func (*LoudsTrie) PredictiveSearch

func (this *LoudsTrie) PredictiveSearch(index int, f func(int))

func (*LoudsTrie) ReverseLookup

func (this *LoudsTrie) ReverseLookup(index uint32, key *[]uint16) int

func (*LoudsTrie) Size

func (this *LoudsTrie) Size() int

func (*LoudsTrie) Traverse

func (this *LoudsTrie) Traverse(index uint32, c uint16) int

type LoudsTrieBuilder

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

func NewLoudsTrieBuilder

func NewLoudsTrieBuilder() *LoudsTrieBuilder

func (*LoudsTrieBuilder) Add

func (self *LoudsTrieBuilder) Add(key []uint16) error

func (*LoudsTrieBuilder) Build

func (self *LoudsTrieBuilder) Build() *LoudsTrie

type RegexGenerator

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

func NewRegexGenerator

func NewRegexGenerator(operator RegexOperator) *RegexGenerator

func (*RegexGenerator) Add

func (this *RegexGenerator) Add(word []uint16)

func (*RegexGenerator) Generate

func (this *RegexGenerator) Generate() []uint16

type RegexNode

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

func NewRegexNode

func NewRegexNode(code uint16) *RegexNode

type RegexOperator

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

func NewRegexOperator

func NewRegexOperator(or string, beginGroup string, endGroup string, beginClass string, endClass string, newline string) *RegexOperator

type RomajiPredictiveResult

type RomajiPredictiveResult struct {
	Prefix   string
	Suffixes []string
}

type RomajiProcessor

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

func NewRomajiProcessor

func NewRomajiProcessor() *RomajiProcessor

func (*RomajiProcessor) RomajiToHiragana

func (this *RomajiProcessor) RomajiToHiragana(romaji string) string

func (*RomajiProcessor) RomajiToHiraganaPredictively

func (this *RomajiProcessor) RomajiToHiraganaPredictively(romaji string) RomajiPredictiveResult

type RomanEntry

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

func NewRomanEntry

func NewRomanEntry(roman string, hiragana string, remain int) *RomanEntry

type SimpleDictionary

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

func BuildSimpleDictionary

func BuildSimpleDictionary(file string) *SimpleDictionary

func (*SimpleDictionary) PredictiveSearch

func (this *SimpleDictionary) PredictiveSearch(hiragana string) []string

type TernaryRegexGenerator

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

func NewTernaryRegexGenerator

func NewTernaryRegexGenerator(operator RegexOperator) *TernaryRegexGenerator

func (*TernaryRegexGenerator) Add

func (this *TernaryRegexGenerator) Add(word []uint16)

func (*TernaryRegexGenerator) Generate

func (this *TernaryRegexGenerator) Generate() []uint16

type TernaryRegexNode

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

Jump to

Keyboard shortcuts

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