1
0
mirror of https://github.com/sjwhitworth/golearn.git synced 2025-04-25 13:48:49 +08:00
golearn/base/filters.go
Richard Townsend ff97065261 base: BinaryConvertFilter, Transform()
Transform now takes a new Attribute so BinaryConvertFilter
 can work correctly
2014-08-03 15:17:18 +01:00

24 lines
647 B
Go

package base
// FilteredAttributes represent a mapping from the output
// generated by a filter to the original value.
type FilteredAttribute struct {
Old Attribute
New Attribute
}
// Filters transform the byte sequences stored in DataGrid
// implementations.
type Filter interface {
// Adds an Attribute to the filter
AddAttribute(Attribute) error
// Allows mapping old to new Attributes
GetAttributesAfterFiltering() []FilteredAttribute
// Gets a string for printing
String() string
// Accepts an old Attribute, the new one and returns a sequence
Transform(Attribute, Attribute, []byte) []byte
// Builds the filter
Train() error
}