Packagenet.reclipse.handwriting
Classpublic dynamic class CharacterDefinition

Data storage and methods for interacting with normalized input sequences.



Public Properties
 PropertyDefined by
  _name : String
CharacterDefinition
  ratio : Number
[read-only] Averages the total collection of ratios.
CharacterDefinition
  _signature : Array
CharacterDefinition
  _signatures : Array
CharacterDefinition
Public Methods
 MethodDefined by
  
CharacterDefinition(name:String = null, signature:Array = null, ratio:Number)
Constructor.
CharacterDefinition
  
addSample(inputSignature:Array, inputRatio:Number):void
Allows addition character definitions for the same character.
CharacterDefinition
  
addStringSample(inputString:String):void
Enables a CharacterDefinition to be defined through syntax like the toString method.
CharacterDefinition
  
pushRatio(nextRatio:Number):Number
Adds a ratio to the collection.
CharacterDefinition
  
pushSignature(nextSignature:Array):Number
Adds a new signature to the Array of known signatures.
CharacterDefinition
  
ratioDifference(inputRatio:Number):Number
Calculates the difference between two ratios.
CharacterDefinition
  
signatureCount(inputSignature:Array):Number
A key componenent of recognition.
CharacterDefinition
  
subSignatureCount(inputSignature:Array):Number
Another key component of recognition.
CharacterDefinition
  
toString():String
Used for permanent storage of CharacterDefinitions.
CharacterDefinition
Property detail
_nameproperty
public var _name:String
ratioproperty 
ratio:Number  [read-only]

Averages the total collection of ratios.

Implementation
    public function get ratio():Number
_signatureproperty 
public var _signature:Array
_signaturesproperty 
public var _signatures:Array
Constructor detail
CharacterDefinition()constructor
public function CharacterDefinition(name:String = null, signature:Array = null, ratio:Number)

Constructor. A full definition can be provided here.

Parameters
name:String (default = null) — The name of the character, this should be one character but can be more.
 
signature:Array (default = null) — An Array of integers (hopefully) unique to a certain character.
 
ratio:Number — A ratio of width:height in the character. Used as a fallback mechanism.
Method detail
addSample()method
public function addSample(inputSignature:Array, inputRatio:Number):void

Allows addition character definitions for the same character.

Parameters
inputSignature:Array — The signature to be added.
 
inputRatio:Number — The width:height ratio of the character being added.
addStringSample()method 
public function addStringSample(inputString:String):void

Enables a CharacterDefinition to be defined through syntax like the toString method.

Parameters
inputString:String — The sample to be added.
pushRatio()method 
public function pushRatio(nextRatio:Number):Number

Adds a ratio to the collection.

Parameters
nextRatio:Number — The ratio to be added.

Returns
Number — The average ratio with the new ratio included.
pushSignature()method 
public function pushSignature(nextSignature:Array):Number

Adds a new signature to the Array of known signatures.

Parameters
nextSignature:Array — The newest signature.

Returns
Number — The total number of signatures.
ratioDifference()method 
public function ratioDifference(inputRatio:Number):Number

Calculates the difference between two ratios. Useful for comparison.

Parameters
inputRatio:Number — A ratio from an external Object.

Returns
Number — The difference.
signatureCount()method 
public function signatureCount(inputSignature:Array):Number

A key componenent of recognition.

Parameters
inputSignature:Array — The signature to be compared.

Returns
Number — The number of instances of the inputSignature that are found in the Array of defined signatures.
subSignatureCount()method 
public function subSignatureCount(inputSignature:Array):Number

Another key component of recognition.

Parameters
inputSignature:Array — The signature to be compared.

Returns
Number — The number of times that the contents of the inputSignature are found in any of the known signatures. Similar to a substring. Should be >= signatureCount.
toString()method 
public function toString():String

Used for permanent storage of CharacterDefinitions.

Returns
String — a String representation of all data in the CharacterDefinition.