First stab at transducer cascade.
More...
Go to the source code of this file.
Functions |
|
static gfsmxlCascade * | gfsmxl_cascade_new_full (guint depth, gfsmSRType srtype) |
static gfsmxlCascade * | gfsmxl_cascade_new (void) |
static void | gfsmxl_cascade_free (gfsmxlCascade *csc, gboolean free_automata) |
void | gfsmxl_cascade_clear (gfsmxlCascade *csc, gboolean free_automata) |
void | gfsmxl_cascade_clear_nth (gfsmxlCascade *csc, guint n, gboolean free_automaton) |
static gfsmIndexedAutomaton * | gfsmxl_cascade_pop (gfsmxlCascade *csc) |
static void | gfsmxl_cascade_set_nth_indexed (gfsmxlCascade *csc, guint n, gfsmIndexedAutomaton *xfsm, gboolean free_old_automaton) |
static void | gfsmxl_cascade_append_indexed (gfsmxlCascade *csc, gfsmIndexedAutomaton *xfsm) |
static void | gfsmxl_cascade_append (gfsmxlCascade *csc, gfsmAutomaton *fsm) |
|
static gfsmxlCascadeStateId | gfsmxl_cascade_get_root (gfsmxlCascade *csc) |
static gfsmxlCascadeStateId | gfsmxl_cascade_stateid_sized_new (guint depth) |
static gfsmxlCascadeStateId | gfsmxl_cascade_stateid_new (gfsmxlCascade *csc) |
static gfsmxlCascadeStateId | gfsmxl_cascade_stateid_sized_copy (gfsmxlCascadeStateId dst, gfsmxlCascadeStateId src, guint depth) |
static gfsmxlCascadeStateId | gfsmxl_cascade_stateid_sized_clone (gfsmxlCascadeStateId src, guint depth) |
static void | gfsmxl_cascade_stateid_free (gfsmxlCascadeStateId qids, guint depth) |
|
static gfsmxlCascadeArc * | gfsmxl_cascade_arc_sized_new (guint depth) |
static gfsmxlCascadeArc * | gfsmxl_cascade_arc_sized_copy (gfsmxlCascadeArc *dst, gfsmxlCascadeArc *src, guint depth) |
static gfsmxlCascadeArc * | gfsmxl_cascade_arc_sized_clone (gfsmxlCascadeArc *src, guint depth) |
static void | gfsmxl_cascade_arc_free (gfsmxlCascadeArc *arc, guint depth) |
|
gfsmWeight | gfsmxl_cascade_get_final_weight (gfsmxlCascade *csc, gfsmxlCascadeStateId qids) |
gboolean | gfsmxl_cascade_state_is_terminable (gfsmxlCascade *csc, gfsmxlCascadeStateId qids, gfsmxlSuffixLength ilen) |
void | gfsmxl_cascade_arciter_open (gfsmxlCascadeArcIter *cai, gfsmxlCascade *csc, gfsmxlCascadeStateId qids, gfsmLabelId lo) |
void | gfsmxl_cascade_arciter_close (gfsmxlCascadeArcIter *cai) |
static gboolean | gfsmxl_cascade_arciter_ok (gfsmxlCascadeArcIter *cai) |
static gfsmxlCascadeArc * | gfsmxl_cascade_arciter_arc (gfsmxlCascadeArcIter *cai) |
static void | gfsmxl_cascade_arciter_next (gfsmxlCascadeArcIter *cai) |
static void | gfsmxl_cascade_arciter_reset (gfsmxlCascadeArcIter *cai) |
static void | gfsmxl_cascade_arciter_insert_arc_ (gfsmxlCascadeArcIter *cai, gfsmxlCascadeArc *carc) |
Arc Utilities: gfsmxlArcPP |
typedef gfsmArc ** | gfsmxlArcPP |
| Type for temporary cascade arcs (array of csc->depth gfsmArc*) a NULL value indicates a pure-epsilon move.
|
static gfsmxlArcPP | gfsmxl_arcpp_sized_new (guint depth) |
static gfsmxlArcPP | gfsmxl_arcpp_sized_copy (gfsmxlArcPP dst, gfsmxlArcPP src, guint depth) |
static gfsmxlArcPP | gfsmxl_arcpp_sized_clone (gfsmxlArcPP src, guint depth) |
static void | gfsmxl_arcpp_free (gfsmxlArcPP arcpp, guint depth) |
static gfsmLabelId | gfsmxl_arcpp_lower (gfsmxlArcPP arcpp) |
static gfsmLabelId | gfsmxl_arcpp_upper (gfsmxlArcPP arcpp, guint depth) |
static gfsmWeight | gfsmxl_arcpp_weight (gfsmxlArcPP arcpp, guint depth, gfsmSemiring *sr) |
static void | gfsmxl_arcpp_target (gfsmxlArcPP arcpp, gfsmxlCascadeStateId src, gfsmxlCascadeStateId dst, guint depth) |
Binary I/O |
const gchar | gfsm_cascade_header_magic [16] |
const gfsmVersionInfo | gfsm_cascade_version_bincompat_min_store |
const gfsmVersionInfo | gfsm_cascade_version_bincompat_min_check |
gboolean | gfsmxl_cascade_load_header (gfsmxlCascadeHeader *hdr, gfsmIOHandle *ioh, gfsmError **errp) |
gboolean | gfsmxl_cascade_load_bin_handle (gfsmxlCascade *csc, gfsmIOHandle *ioh, gfsmError **errp) |
gboolean | gfsmxl_cascade_load_bin_file (gfsmxlCascade *csc, FILE *f, gfsmError **errp) |
gboolean | gfsmxl_cascade_load_bin_filename (gfsmxlCascade *csc, const gchar *filename, gfsmError **errp) |
gboolean | gfsmxl_cascade_load_bin_gstring (gfsmxlCascade *csc, GString *gs, gfsmError **errp) |
gboolean | gfsmxl_cascade_save_bin_handle (gfsmxlCascade *csc, gfsmIOHandle *ioh, gfsmError **errp) |
gboolean | gfsmxl_cascade_save_bin_file (gfsmxlCascade *csc, FILE *f, gfsmError **errp) |
gboolean | gfsmxl_cascade_save_bin_filename_nc (gfsmxlCascade *csc, const gchar *filename, gfsmError **errp) |
gboolean | gfsmxl_cascade_save_bin_filename (gfsmxlCascade *csc, const gchar *filename, int zlevel, gfsmError **errp) |
gboolean | gfsmxl_cascade_save_bin_gstring (gfsmxlCascade *csc, GString *gs, gfsmError **errp) |
Detailed Description
Macro Definition Documentation
#define CASCADE_USE_BLOCK_INDEX 1 |
#define CASCADE_USE_BLOCKS 1 |
#define gfsmxl_cascade_index |
( |
|
csc_, |
|
|
|
index_ |
|
) |
| ((gfsmIndexedAutomaton*)g_ptr_array_index((csc_)->xfsms,(index_))) |
Macro to get a pointer to the gfsmIndexedAutomaton at depth index_ in csc_. csc_ must have depth at least index_+1 for this to work
Typedef Documentation
Function Documentation
Create a new indexed automaton, using some default values
static void gfsmxl_cascade_free |
( |
gfsmxlCascade * |
csc, |
|
|
gboolean |
free_automata |
|
) |
| |
|
inlinestatic |
void gfsmxl_cascade_clear |
( |
gfsmxlCascade * |
csc, |
|
|
gboolean |
free_automata |
|
) |
| |
void gfsmxl_cascade_clear_nth |
( |
gfsmxlCascade * |
csc, |
|
|
guint |
n, |
|
|
gboolean |
free_automaton |
|
) |
| |
Clear the n-th element of a gfsmxlCascade (invalidates the cascade)
Steal the rightmost automaton from a cascade; calls gfsmxl_cascade_clear_nth(csc,csc->depth-1,FALSE)
Set the n-th element of a gfsmxlCascade; calls gfsm_cascade_clear_nth(csc,n,free_old_automaton)
Append an indexed automaton to a cascade. Steals xfsm
Sort arcs of all sub-automata
Get root-id of cascade (never free this yourself!)
static gfsmxlArcPP gfsmxl_arcpp_sized_new |
( |
guint |
depth | ) |
|
|
inlinestatic |
Allocate a new gfsmxlArcPP suitable for a cascade of depth
static void gfsmxl_arcpp_free |
( |
gfsmxlArcPP |
arcpp, |
|
|
guint |
depth |
|
) |
| |
|
inlinestatic |
Copy target state of a gfsmxlArcPP to dst, assuming start state was src
Get state final weight or csc->sr->zero if state is non-final
Check whether a gfsmxlCascadeStateId is terminable Only useful if GFSMXL_USE_SUFFIX_INDEX is defined
Open outgoing arcs from state qids in csc with ultimate lower label eithr epsilon or lo.
- Clones qids into arcs->qids.
- Allocates some temporaries, including any and all arcs found
Close a cascade arc iterator cai, freeing any data associated with it
Get current arc from a gfsmxlCascadeArcIter.
- Assumes that cai is valid.
- Returned arc will be freed when cai is closed
Low-level utility: insert an arc into a ->arclist, unsorted
Load an automaton header from a stored binary file. Returns TRUE iff the header looks valid.
Load an automaton from a named binary file (implicitly clear()s fsm)
Load an automaton from a stored binary file (implicitly clear()s fsm)
Load an automaton from a named binary file (implicitly clear()s fsm)
Load an automaton from an in-memory buffer
Store an automaton in binary form to a gfsmIOHandle*
Store an automaton in binary form to a file
gboolean gfsmxl_cascade_save_bin_filename_nc |
( |
gfsmxlCascade * |
csc, |
|
|
const gchar * |
filename, |
|
|
gfsmError ** |
errp |
|
) |
| |
Store an automaton to a named binary file (no compression)
gboolean gfsmxl_cascade_save_bin_filename |
( |
gfsmxlCascade * |
csc, |
|
|
const gchar * |
filename, |
|
|
int |
zlevel, |
|
|
gfsmError ** |
errp |
|
) |
| |
Store an automaton to a named binary file, possibly compressing. Set zlevel=-1 for default compression, and set zlevel=0 for no compression, otherwise should be as for zlib (1 <= zlevel <= 9)
Append an uncompressed binary automaton to an in-memory buffer
Variable Documentation
const gchar gfsm_cascade_header_magic[16] |
Minimum libgfsm version required for loading files stored by this version of libgfsm
Minimum libgfsm version whose binary files this version of libgfsm can read