C# Class Ocronet.Dynamic.OcroFST.FstUtil

显示文件 Open project: nickun/OCRonet Class Usage Examples

Public Methods

Method Description
fst_copy ( IGenericFst dst, IGenericFst src ) : void

Copy one FST to another.

fst_copy_best_arcs_only ( IGenericFst dst, IGenericFst src ) : void

Copy one FST to another, preserving only lowest-cost arcs. This is useful for visualization.

fst_copy_reverse ( IGenericFst dst, IGenericFst src, bool no_accept = false ) : void

Reverse the FST's arcs, adding a new start vertex (former accept).

fst_expand_composition ( IGenericFst outf, OcroFST f1, OcroFST f2 ) : void

Compose two FSTs. This function copies the composition of two given FSTs. That causes expansion (storing all arcs explicitly).

fst_line ( IGenericFst fst, string s ) : void
fst_sample ( Intarray result, IGenericFst fst, int max = 1000 ) : double

Randomly sample an FST, assuming any input.

fst_sample ( string &result, IGenericFst fst, int max ) : double

Randomly sample an FST, assuming any input.

fst_star ( IGenericFst fst ) : void

Make an in-place Kleene closure of the FST.

fst_star ( IGenericFst result, IGenericFst fst ) : void

Make a Kleene closure.

remove_epsilons ( string &outs, Intarray a ) : void

Remove epsilons (zeros) and converts integers to string.

sample_by_costs ( Floatarray costs ) : int

Pick an array element with probability proportional to exp(-cost).

scale_fst ( OcroFST fst, float scale ) : void

Method Details

fst_copy() public static method

Copy one FST to another.
public static fst_copy ( IGenericFst dst, IGenericFst src ) : void
dst Ocronet.Dynamic.Interfaces.IGenericFst The destination. Will be cleared before copying.
src Ocronet.Dynamic.Interfaces.IGenericFst The FST to copy.
return void

fst_copy_best_arcs_only() public static method

Copy one FST to another, preserving only lowest-cost arcs. This is useful for visualization.
public static fst_copy_best_arcs_only ( IGenericFst dst, IGenericFst src ) : void
dst Ocronet.Dynamic.Interfaces.IGenericFst The destination. Will be cleared before copying.
src Ocronet.Dynamic.Interfaces.IGenericFst The FST to copy.
return void

fst_copy_reverse() public static method

Reverse the FST's arcs, adding a new start vertex (former accept).
public static fst_copy_reverse ( IGenericFst dst, IGenericFst src, bool no_accept = false ) : void
dst Ocronet.Dynamic.Interfaces.IGenericFst
src Ocronet.Dynamic.Interfaces.IGenericFst
no_accept bool
return void

fst_expand_composition() public static method

Compose two FSTs. This function copies the composition of two given FSTs. That causes expansion (storing all arcs explicitly).
public static fst_expand_composition ( IGenericFst outf, OcroFST f1, OcroFST f2 ) : void
outf Ocronet.Dynamic.Interfaces.IGenericFst
f1 OcroFST
f2 OcroFST
return void

fst_line() public static method

public static fst_line ( IGenericFst fst, string s ) : void
fst Ocronet.Dynamic.Interfaces.IGenericFst
s string
return void

fst_sample() public static method

Randomly sample an FST, assuming any input.
public static fst_sample ( Intarray result, IGenericFst fst, int max = 1000 ) : double
result Intarray The array of output symbols, excluding epsilons.
fst Ocronet.Dynamic.Interfaces.IGenericFst The FST.
max int The maximum length of the result.
return double

fst_sample() public static method

Randomly sample an FST, assuming any input.
public static fst_sample ( string &result, IGenericFst fst, int max ) : double
result string
fst Ocronet.Dynamic.Interfaces.IGenericFst
max int
return double

fst_star() public static method

Make an in-place Kleene closure of the FST.
public static fst_star ( IGenericFst fst ) : void
fst Ocronet.Dynamic.Interfaces.IGenericFst
return void

fst_star() public static method

Make a Kleene closure.
public static fst_star ( IGenericFst result, IGenericFst fst ) : void
result Ocronet.Dynamic.Interfaces.IGenericFst
fst Ocronet.Dynamic.Interfaces.IGenericFst
return void

remove_epsilons() public static method

Remove epsilons (zeros) and converts integers to string.
public static remove_epsilons ( string &outs, Intarray a ) : void
outs string
a Intarray
return void

sample_by_costs() public static method

Pick an array element with probability proportional to exp(-cost).
public static sample_by_costs ( Floatarray costs ) : int
costs Floatarray
return int

scale_fst() public static method

public static scale_fst ( OcroFST fst, float scale ) : void
fst OcroFST
scale float
return void