Documentation ¶
Index ¶
- Constants
- Variables
- type Character
- type Features
- type KanjiFeature
- type KanjiFeatureManager
- func (m KanjiFeatureManager) Get(c Character) KanjiFeature
- func (m KanjiFeatureManager) LengthMask(fullNameLength, charPosition int) (Features, error)
- func (m KanjiFeatureManager) OrderMask(fullNameLength, charPosition int) (Features, error)
- func (m KanjiFeatureManager) SelectLengthFeaturePosition(pieceOfName PartOfNameCharacters) (LengthFeatureIndexPosition, error)
- func (m KanjiFeatureManager) SelectOrderFeaturePosition(pieceOfName PartOfNameCharacters, positionInPieceOfName int) (OrderFeatureIndexPosition, error)
- type KanjiLengthFeatureCalculator
- type KanjiOrderFeatureCalculator
- type LengthFeatureIndexPosition
- type OrderFeatureIndexPosition
- type PartOfNameCharacters
Constants ¶
View Source
const ( CharacterFeatureSize = 1 OrderFeatureSize = 6 LengthFeatureSize = 8 OrderFirstFeatureIndex = OrderFeatureIndexPosition(0) OrderMiddleFeatureIndex = OrderFeatureIndexPosition(1) OrderEndFeatureIndex = OrderFeatureIndexPosition(2) )
Variables ¶
View Source
var ( ErrOrderFeatureInvalidSize = errors.New("order feature's length must be 6") ErrLengthFeatureInvalidSize = errors.New("length feature's length must be 8") ErrInvalidFeatureSize = errors.New("feature-to-feature calculations must be the same size") ErrOutRangeOrderMask = errors.New("character position is out of range when creating mask") ErrInvalidOrderMask = errors.New("first character and last character must not be created order mask") ErrOutRangeFeatureIndex = errors.New("character position is out of range when selecting features") )
Functions ¶
This section is empty.
Types ¶
type KanjiFeature ¶
func DefaultKanjiFeature ¶
func DefaultKanjiFeature() KanjiFeature
func NewKanjiFeature ¶
func NewKanjiFeature(c Character, o, l []float64) (KanjiFeature, error)
func (KanjiFeature) GetLengthValue ¶
func (k KanjiFeature) GetLengthValue(p LengthFeatureIndexPosition, mask Features) (float64, error)
func (KanjiFeature) GetOrderValue ¶
func (k KanjiFeature) GetOrderValue(p OrderFeatureIndexPosition, mask Features) (float64, error)
type KanjiFeatureManager ¶
type KanjiFeatureManager struct {
KanjiFeatureMap map[Character]KanjiFeature
}
func (KanjiFeatureManager) Get ¶
func (m KanjiFeatureManager) Get(c Character) KanjiFeature
func (KanjiFeatureManager) LengthMask ¶
func (m KanjiFeatureManager) LengthMask(fullNameLength, charPosition int) (Features, error)
func (KanjiFeatureManager) OrderMask ¶
func (m KanjiFeatureManager) OrderMask(fullNameLength, charPosition int) (Features, error)
func (KanjiFeatureManager) SelectLengthFeaturePosition ¶
func (m KanjiFeatureManager) SelectLengthFeaturePosition(pieceOfName PartOfNameCharacters) (LengthFeatureIndexPosition, error)
func (KanjiFeatureManager) SelectOrderFeaturePosition ¶
func (m KanjiFeatureManager) SelectOrderFeaturePosition(pieceOfName PartOfNameCharacters, positionInPieceOfName int) (OrderFeatureIndexPosition, error)
type KanjiLengthFeatureCalculator ¶
type KanjiLengthFeatureCalculator struct {
Manager KanjiFeatureManager
}
func (KanjiLengthFeatureCalculator) Score ¶
func (fc KanjiLengthFeatureCalculator) Score(pieceOfName PartOfNameCharacters, fullNameLength int) (float64, error)
type KanjiOrderFeatureCalculator ¶
type KanjiOrderFeatureCalculator struct {
Manager KanjiFeatureManager
}
func (KanjiOrderFeatureCalculator) Score ¶
func (fc KanjiOrderFeatureCalculator) Score(pieceOfName PartOfNameCharacters, fullNameLength int) (float64, error)
type LengthFeatureIndexPosition ¶
type LengthFeatureIndexPosition int
func (LengthFeatureIndexPosition) MoveFirstNameIndex ¶
func (i LengthFeatureIndexPosition) MoveFirstNameIndex() LengthFeatureIndexPosition
type OrderFeatureIndexPosition ¶
type OrderFeatureIndexPosition int
func (OrderFeatureIndexPosition) MoveFirstNameIndex ¶
func (i OrderFeatureIndexPosition) MoveFirstNameIndex() OrderFeatureIndexPosition
type PartOfNameCharacters ¶
Click to show internal directories.
Click to hide internal directories.