C# Class Ocronet.Dynamic.Interfaces.IGenericFst

A generic interface for language models. An IGenericFst is a directed graph with output/cost/id written on arcs, accept cost written on vertices and a fixed start vertice.
Inheritance: IComponent, IDisposable
Mostrar archivo Open project: nickun/OCRonet Class Usage Examples

Public Methods

Method Description
AddTransition ( int from, int to, int symbol, float cost ) : void

A variant of addTransition() with equal input and output.

AddTransition ( int from, int to, int output, float cost, int input ) : void

Add a transition between the given states

Arcs ( Intarray ids, Intarray targets, Intarray outputs, Floatarray costs, int from ) : void

Return an array of arcs leading from the given node. WARN_DEPRECATED

BestPath ( string &result ) : double

Compute the best path through the language model. Useful for simple OCR tasks and for debugging.

Clear ( ) : void

Clear the language model

Dispose ( ) : void

destroy the language model

GetAcceptCost ( int node ) : float

Get the accept cost of a given vertex (a cost to finish the line and quit).

GetStart ( ) : int

Get the starting state.

GetTransitions ( Intarray tos, Intarray symbols, Floatarray costs, Intarray inputs, int from ) : void

A variant of addTransition() with equal input and output.

MakeFst ( string name ) : IGenericFst

Создает экземпляр класса, наследованного от IGenericFst

NewState ( ) : int

Get a single new state

Rescore ( int from, int to, int symbol, float new_cost ) : void

A variant of rescore() with equal input and output.

Rescore ( int from, int to, int output, float new_cost, int input ) : void

Change a transition score between the given states

SetAccept ( int node, float cost = 0.0f ) : void

Set a state as an accept state

SetStart ( int node ) : void

Set the start state

SetString ( string text, Floatarray costs, Intarray ids ) : void

simple interface for line recognizers

Special ( string s ) : int

Obtain codes for "specials" (language model dependent)

isAccepting ( int node ) : bool

Determine whether the given node is an accepting state.

nStates ( ) : int

Get the number of states.

Method Details

AddTransition() public method

A variant of addTransition() with equal input and output.
public AddTransition ( int from, int to, int symbol, float cost ) : void
from int
to int
symbol int
cost float
return void

AddTransition() public abstract method

Add a transition between the given states
public abstract AddTransition ( int from, int to, int output, float cost, int input ) : void
from int
to int
output int
cost float
input int
return void

Arcs() public method

Return an array of arcs leading from the given node. WARN_DEPRECATED
public Arcs ( Intarray ids, Intarray targets, Intarray outputs, Floatarray costs, int from ) : void
ids Intarray
targets Intarray
outputs Intarray
costs Floatarray
from int
return void

BestPath() public abstract method

Compute the best path through the language model. Useful for simple OCR tasks and for debugging.
public abstract BestPath ( string &result ) : double
result string
return double

Clear() public abstract method

Clear the language model
public abstract Clear ( ) : void
return void

Dispose() public method

destroy the language model
public Dispose ( ) : void
return void

GetAcceptCost() public method

Get the accept cost of a given vertex (a cost to finish the line and quit).
public GetAcceptCost ( int node ) : float
node int
return float

GetStart() public method

Get the starting state.
public GetStart ( ) : int
return int

GetTransitions() public method

A variant of addTransition() with equal input and output.
public GetTransitions ( Intarray tos, Intarray symbols, Floatarray costs, Intarray inputs, int from ) : void
tos Intarray
symbols Intarray
costs Floatarray
inputs Intarray
from int
return void

MakeFst() public static method

Создает экземпляр класса, наследованного от IGenericFst
public static MakeFst ( string name ) : IGenericFst
name string имя класа
return IGenericFst

NewState() public abstract method

Get a single new state
public abstract NewState ( ) : int
return int

Rescore() public method

A variant of rescore() with equal input and output.
public Rescore ( int from, int to, int symbol, float new_cost ) : void
from int
to int
symbol int
new_cost float
return void

Rescore() public method

Change a transition score between the given states
public Rescore ( int from, int to, int output, float new_cost, int input ) : void
from int
to int
output int
new_cost float
input int
return void

SetAccept() public abstract method

Set a state as an accept state
public abstract SetAccept ( int node, float cost = 0.0f ) : void
node int
cost float
return void

SetStart() public abstract method

Set the start state
public abstract SetStart ( int node ) : void
node int
return void

SetString() public method

simple interface for line recognizers
public SetString ( string text, Floatarray costs, Intarray ids ) : void
text string
costs Floatarray
ids Intarray
return void

Special() public abstract method

Obtain codes for "specials" (language model dependent)
public abstract Special ( string s ) : int
s string
return int

isAccepting() public method

Determine whether the given node is an accepting state.
public isAccepting ( int node ) : bool
node int
return bool

nStates() public method

Get the number of states.
public nStates ( ) : int
return int