Documentation ¶
Overview ¶
Package keyize provides abstractions to be used for the representation and computation of keystroke-related data. Keyize supports a wide array of keystroke recording and keystroke dynamics processing activities.
Index ¶
- Constants
- type Dynamics
- func (d *Dynamics) AddProperty(p *DynamicsProperty)
- func (d *Dynamics) AddPropertyByName(name string, value float64) error
- func (d *Dynamics) AvgScaledPropDiff(a *Dynamics, propertyKindScaleMap DynamicsPropertyKindScaleMap) float64
- func (d *Dynamics) EuclideanDist(a *Dynamics, propertyKindScaleMap DynamicsPropertyKindScaleMap) (dist float64)
- func (d *Dynamics) ManhattanDist(a *Dynamics, propertyKindScaleMap DynamicsPropertyKindScaleMap) (dist float64)
- func (d *Dynamics) Properties() map[string]*DynamicsProperty
- func (d *Dynamics) ProportionMatch(a *Dynamics) float64
- func (d *Dynamics) ProportionSharedProperties(a *Dynamics, method SharedPropertiesMethod) float64
- func (d *Dynamics) RemoveProperty(p *DynamicsProperty)
- func (d *Dynamics) SharedProperties(a *Dynamics, method SharedPropertiesMethod) (shared int, total int)
- type DynamicsProperty
- type DynamicsPropertyKind
- type DynamicsPropertyKindScaleMap
- type RawEventKind
- type Recording
- type RecordingEvent
- type SharedPropertiesMethod
Constants ¶
const AvgScaledPropDiffOther float64 = 16.85
const AvgScaledPropDiffSame float64 = 7.69
Scaling for use in ProportionMatch. Provides a range for mapping result from AvgScaledPropDiff.
Original detected average range is: 7.69, 16.85
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dynamics ¶
type Dynamics struct {
// contains filtered or unexported fields
}
Dynamics represents a group of dynamics properties
func AvgDynamics ¶
AvgDynamics returns a pointer to a new Dynamics which is the average of all Dynamics contained from d.
func NewDynamics ¶
func NewDynamics() *Dynamics
func (*Dynamics) AddProperty ¶
func (d *Dynamics) AddProperty(p *DynamicsProperty)
AddProperty adds DynamicsProperty p to the internal map in Dynamics d.
func (*Dynamics) AddPropertyByName ¶
AddPropertyByName adds DynamicsProperty p to the internal map in Dynamics d from name.
func (*Dynamics) AvgScaledPropDiff ¶
func (d *Dynamics) AvgScaledPropDiff(a *Dynamics, propertyKindScaleMap DynamicsPropertyKindScaleMap) float64
AvgScaledPropDiff returns the average distance between scaled values of properties shared between Dynamics d and a.
func (*Dynamics) EuclideanDist ¶
func (d *Dynamics) EuclideanDist(a *Dynamics, propertyKindScaleMap DynamicsPropertyKindScaleMap) (dist float64)
EuclideanDist uses the Euclidean distance metric to find distance between Dynamics d and a.
It uses propertyKindScaleMap for scaling. nil may be passed for propertyKindScaleMap and the optimized defaults will be used.
func (*Dynamics) ManhattanDist ¶
func (d *Dynamics) ManhattanDist(a *Dynamics, propertyKindScaleMap DynamicsPropertyKindScaleMap) (dist float64)
ManhattanDist uses the Manhattan distance metric to find distance between Dynamics d and a.
It uses propertyKindScaleMap for scaling. nil may be passed for propertyKindScaleMap and the optimized defaults will be used.
func (*Dynamics) Properties ¶
func (d *Dynamics) Properties() map[string]*DynamicsProperty
Properties returns the internally managed set of properties.
func (*Dynamics) ProportionMatch ¶
ProportionMatch returns a usable match proportion between Dynamics d and a, on a scale of 0.0 to 1.0.
func (*Dynamics) ProportionSharedProperties ¶
func (d *Dynamics) ProportionSharedProperties(a *Dynamics, method SharedPropertiesMethod) float64
ProportionSharedProperties returns the proportion of properties shared between Dynamics d and a with respect to SharedPropertiesMethod method.
func (*Dynamics) RemoveProperty ¶
func (d *Dynamics) RemoveProperty(p *DynamicsProperty)
RemoveProperty removes DynamicsProperty p from the internal map in Dynamics d.
func (*Dynamics) SharedProperties ¶
func (d *Dynamics) SharedProperties(a *Dynamics, method SharedPropertiesMethod) (shared int, total int)
SharedProperties returns the count of properties shared between Dynamics d and a as well as the count of total properties considered with respect to SharedPropertiesMethod method.
type DynamicsProperty ¶
type DynamicsProperty struct { Kind DynamicsPropertyKind KeyA rune KeyB rune Value float64 }
DynamicsProperty is a keystroke dynamics property, often synthesized from a Recording.
func ParseDynamicsPropertyName ¶
func ParseDynamicsPropertyName(n string) (*DynamicsProperty, error)
func (*DynamicsProperty) Name ¶
func (d *DynamicsProperty) Name() string
Name provides the name for the property (this can be used as a key by a Dynamics)
type DynamicsPropertyKind ¶
type DynamicsPropertyKind int
const ( Dwell DynamicsPropertyKind = iota DownDown UpDown )
type DynamicsPropertyKindScaleMap ¶
type DynamicsPropertyKindScaleMap map[DynamicsPropertyKind]float64
DynamicsPropertyKindScaleMap is a map of DynamicsPropertyKind to scaling values. It is used when calculating distance between multiple Dynamics.
If a key is missing, it may be replaced with the default, optimized value if present. Using the optimized default scale values by passing nil to distance methods for the propertyKindScaleMap argument is recommended.
type Recording ¶
type Recording struct {
Events []*RecordingEvent
}
Recording represents a user's raw typing recording
func ImportKeyizeV1 ¶
ImportKeyizeV1 imports a keystroke recording of the Keyize V1 format. These recordings may be generated from users by a corresponding recording library.
type RecordingEvent ¶
type RecordingEvent struct { At int Kind RawEventKind Subject rune }
RecordingEvent is a specific event which took place during a recording
type SharedPropertiesMethod ¶
type SharedPropertiesMethod int
const ( // Consider properties from Dynamics d and a Both SharedPropertiesMethod = iota // Consider properties from only Dynamics d Left // Consider properties from only Dynamics a Right )