Data storage and methods for interacting with normalized input sequences.
public var _name:String
ratio:Number
[read-only]
Averages the total collection of ratios.
Implementation
public function get ratio():Number
public var _signature:Array
public var _signatures:Array
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.
|
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.
|
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.
|
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.
|
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.
|
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
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.
|
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.
|
public function toString():String
Used for permanent storage of CharacterDefinitions.
Returns
| String — a String representation of all data in the CharacterDefinition.
|
Sun Aug 20 2006, 11:39 AM GMT-04:00