Documentation ¶
Index ¶
- Constants
- Variables
- func GetArray(input []interface{}) interface{}
- func GetArrayInt(input []int) interface{}
- type Configuration
- type ConfigurationSequence
- type ConstTransition
- type Decision
- type FeatureGroup
- type FeatureSetup
- type FeatureTemplate
- type FeatureTemplateElement
- type FeaturesList
- type GenericExtractor
- func (x *GenericExtractor) EstimatedNumberOfFeatures() int
- func (x *GenericExtractor) Features(instance Instance, idle bool, transType byte, transitions []int) []Feature
- func (x *GenericExtractor) GetFeature(conf Configuration, template FeatureTemplate, ...) (interface{}, bool)
- func (x *GenericExtractor) GetFeatureElement(conf Configuration, templateElement *FeatureTemplateElement, ...) (interface{}, bool, bool)
- func (x *GenericExtractor) Init()
- func (x *GenericExtractor) InitTypes(transTypes []byte)
- func (x *GenericExtractor) LoadFeature(featTemplateStr string, requirements string, transitionType string, ...) error
- func (x *GenericExtractor) LoadFeatureSetup(setup *FeatureSetup)
- func (x *GenericExtractor) LoadFeatures(reader io.Reader) error
- func (x *GenericExtractor) ParseFeatureElement(featElementStr string) (*FeatureTemplateElement, error)
- func (x *GenericExtractor) ParseFeatureTemplate(featTemplateStr string, requirements string) (*FeatureTemplate, error)
- func (x *GenericExtractor) ParseMorphConfiguration(morphTemplateStr string) *MorphElement
- func (x *GenericExtractor) SetLog(val bool)
- func (x *GenericExtractor) UpdateFeatureElementCache(feat *FeatureTemplate, idle bool)
- type MorphElement
- type MorphTemplate
- type Oracle
- type TransTypeGroup
- type Transition
- type TransitionSystem
- type TypedTransition
Constants ¶
View Source
const ( FEATURE_SEPARATOR = "+" // separates multiple attribute sources ATTRIBUTE_SEPARATOR = "|" // separates attributes in a source TEMPLATE_PREFIX = ":" // output separator GENERIC_SEPARATOR = "|" // output separator FEATURE_REQUIREMENTS_SEPARATOR = "," // separates template from requirements REQUIREMENTS_SEPARATOR = ";" // separates multiple requirements APPROX_ELEMENTS = 20 ALLOW_IDLE = true )
Variables ¶
View Source
var IDLE = &TypedTransition{'I', 0}
View Source
var (
S0R2l, S0Rl int = -1, -1
)
Functions ¶
func GetArrayInt ¶
func GetArrayInt(input []int) interface{}
Types ¶
type Configuration ¶
type Configuration interface { Init(interface{}) Terminal() bool Copy() Configuration CopyTo(Configuration) Clear() Len() int Previous() Configuration SetPrevious(Configuration) GetSequence() ConfigurationSequence SetLastTransition(Transition) GetLastTransition() Transition String() string Equal(otherEq util.Equaler) bool Address(location []byte, offset int) (nodeID int, exists bool, isGenerator bool) GenerateAddresses(nodeID int, location []byte) (nodeIDs []int) Attribute(source byte, nodeID int, attribute []byte, transitions []int) (attributeValue interface{}, exists bool, isGenerator bool) Assignment() uint16 State() byte }
type ConfigurationSequence ¶
type ConfigurationSequence []Configuration
func (ConfigurationSequence) Equal ¶
func (seq ConfigurationSequence) Equal(otherEq util.Equaler) bool
func (ConfigurationSequence) SharedTransitions ¶
func (seq ConfigurationSequence) SharedTransitions(other ConfigurationSequence) int
func (ConfigurationSequence) String ¶
func (seq ConfigurationSequence) String() string
type ConstTransition ¶
type ConstTransition int
func (ConstTransition) Equal ¶
func (b ConstTransition) Equal(other Transition) bool
func (ConstTransition) Type ¶
func (b ConstTransition) Type() byte
func (ConstTransition) Value ¶
func (b ConstTransition) Value() int
type Decision ¶
type Decision interface {
Transition(Configuration) Transition
}
type FeatureGroup ¶
type FeatureSetup ¶
type FeatureSetup struct { FeatureGroups []FeatureGroup `yaml:"feature groups"` MorphTemplates []MorphTemplate `yaml:"morph templates"` }
func LoadFeatureConf ¶
func LoadFeatureConf(conf []byte) *FeatureSetup
func LoadFeatureConfFile ¶
func LoadFeatureConfFile(filename string) (*FeatureSetup, error)
func (*FeatureSetup) NumFeatures ¶
func (s *FeatureSetup) NumFeatures() int
type FeatureTemplate ¶
type FeatureTemplate struct { Elements []FeatureTemplateElement Requirements []string ID int CachedElementIDs []int // where to find the feature elements of the template in the cache CachedReqIDs []int // cached address required to exist for element EWord, EPOS, EWPOS, ERel, EMHost, EMSuffix *util.EnumSet EMorphProp, EToken *util.EnumSet TransitionType string Associated bool }
func (FeatureTemplate) Format ¶
func (f FeatureTemplate) Format(val interface{}) string
func (FeatureTemplate) FormatWithGenerator ¶
func (f FeatureTemplate) FormatWithGenerator(val interface{}, isGenerator bool) string
func (FeatureTemplate) String ¶
func (f FeatureTemplate) String() string
type FeatureTemplateElement ¶
type FeaturesList ¶
type FeaturesList struct { Features []Feature Transition Transition Previous *FeaturesList }
func (*FeaturesList) String ¶
func (l *FeaturesList) String() string
type GenericExtractor ¶
type GenericExtractor struct { EFeatures *util.EnumSet TransTypeGroups map[byte]*TransTypeGroup Concurrent bool Log bool EWord, EPOS, EWPOS, ERel, EMHost, EMSuffix, EToken *util.EnumSet EMorphProp *util.EnumSet POPTrans Transition }
func (*GenericExtractor) EstimatedNumberOfFeatures ¶
func (x *GenericExtractor) EstimatedNumberOfFeatures() int
func (*GenericExtractor) Features ¶
func (x *GenericExtractor) Features(instance Instance, idle bool, transType byte, transitions []int) []Feature
func (*GenericExtractor) GetFeature ¶
func (x *GenericExtractor) GetFeature(conf Configuration, template FeatureTemplate, featureValues, attrValues []interface{}) (interface{}, bool)
func (*GenericExtractor) GetFeatureElement ¶
func (x *GenericExtractor) GetFeatureElement(conf Configuration, templateElement *FeatureTemplateElement, attrValues []interface{}, transitions []int) (interface{}, bool, bool)
func (*GenericExtractor) Init ¶
func (x *GenericExtractor) Init()
func (*GenericExtractor) InitTypes ¶
func (x *GenericExtractor) InitTypes(transTypes []byte)
func (*GenericExtractor) LoadFeature ¶
func (*GenericExtractor) LoadFeatureSetup ¶
func (x *GenericExtractor) LoadFeatureSetup(setup *FeatureSetup)
func (*GenericExtractor) LoadFeatures ¶
func (x *GenericExtractor) LoadFeatures(reader io.Reader) error
func (*GenericExtractor) ParseFeatureElement ¶
func (x *GenericExtractor) ParseFeatureElement(featElementStr string) (*FeatureTemplateElement, error)
func (*GenericExtractor) ParseFeatureTemplate ¶
func (x *GenericExtractor) ParseFeatureTemplate(featTemplateStr string, requirements string) (*FeatureTemplate, error)
func (*GenericExtractor) ParseMorphConfiguration ¶
func (x *GenericExtractor) ParseMorphConfiguration(morphTemplateStr string) *MorphElement
func (*GenericExtractor) SetLog ¶
func (x *GenericExtractor) SetLog(val bool)
func (*GenericExtractor) UpdateFeatureElementCache ¶
func (x *GenericExtractor) UpdateFeatureElementCache(feat *FeatureTemplate, idle bool)
type MorphElement ¶
type MorphTemplate ¶
type TransTypeGroup ¶
type TransTypeGroup struct { FeatureTemplates []FeatureTemplate ElementEnum *util.EnumSet Elements []FeatureTemplateElement }
type Transition ¶
type Transition interface { Type() byte Value() int Equal(other Transition) bool }
type TransitionSystem ¶
type TransitionSystem interface { Transition(from Configuration, transition Transition) Configuration TransitionTypes() []string YieldTransitions(conf Configuration) (transType byte, transitions chan int) GetTransitions(conf Configuration) (transType byte, transitions []int) Oracle() Oracle AddDefaultOracle() Name() string }
type TypedTransition ¶
func (*TypedTransition) Equal ¶
func (t *TypedTransition) Equal(other Transition) bool
func (*TypedTransition) Type ¶
func (t *TypedTransition) Type() byte
func (*TypedTransition) Value ¶
func (t *TypedTransition) Value() int
Click to show internal directories.
Click to hide internal directories.