name: SymbolGraph
synopsis:

>     g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_search.a

>     #include <SymbolGraph.h>

>     boolean readDataText(Sof& sof_a, const String& pname, long size, boolean param, boolean nested);
>     boolean readDataBinary(Sof& sof);
>     boolean writeTextData(Sof& sof, const String& pname, Vector<Long>& nodes, Vector<Triple<Long, Long, String> >& symbols, Vector<Triple<Pair<Long, Long>, Float, Float> >& arcs) const;
>     boolean writeBinaryData(Sof& sof, const String& pname, Vector<Long>& nodes, Vector<Triple<Long, Long, String> >& symbols, Vector<Triple<Pair<Long, Long>, Float, Float> >& arcs) const;
>     boolean getFormat(String& arg);
>     boolean setFormat(const String& arg);
>     float getScale() const;
>     boolean setScale(const float arg);
>     float getPenalty() const;
>     boolean setPenalty(const float arg);
>     long getOrder() const;
>     boolean setOrder(const long arg);
>     SingleLinkedList<SymbolGraphNode>& getNodes();
>     long getNumNodes() const;
>     boolean setNumNodes(const long arg);
>     long getNumArcs() const;
>     boolean setNumArcs(const long arg);
>     SymbolGraphNode* getStart();
>     SymbolGraphNode* getTerm();
>     boolean incrementNodes();
>     boolean decrementNodes();
>     boolean incrementArcs();
>     boolean decrementArcs();
>     boolean find(const SymbolGraphNode* obj);
>     boolean contains(const SymbolGraphNode* obj);
>     SymbolGraphNode* insertNode(long frame, const String& str = DEF_SYMBOL);
>     boolean removeNode(SymbolGraphNode* obj);
>     boolean prune();
>     boolean compact(SymbolGraph& graph);
>     boolean convert(SearchLevel& level, DiGraph<SearchNode>& digraph);

quick start:

>     SearchSymbol symbol_str;
>     ulong frame_index = 7;

>     SymbolGraph symbol_graph;
>     SymbolGraphNode* start_node;

>     start_node = symbol_graph.getStart();
>     symbol_graph.insertNode(frame_index, symbol_str);

description:
This class represents the graph data structure that is used in the combination with the SymbolGraphNode class to represent a word-graph, which is used for the word-graph generation and rescoring modes in the recognizer.
dependencies:

- SymbolGraphNode

public constants:

- define public constants:

      static const String CLASS_NAME;

      static const String DEF_PARAM;

      static const String DEF_SYMBOL;

      static const String DEF_FORMAT;

      static const String PARAM_FORMAT;

      static const String PARAM_VERSION;

      static const String PARAM_SCALE;

      static const String PARAM_PENALTY;

      static const String DEF_START_SYMBOL;

      static const String DEF_TERM_SYMBOL;

      static const float DEF_SCALE = 1.0;

      static const float DEF_PENALTY = 0.0;

      static const float DEF_FRAME_DURATION = 0.01;

      static const long DEF_ORDER = 1;

      static const long DEF_NUM_NODES = 0;

      static const long DEF_NUM_ARCS = 0;

error codes:

- error codes indicating general errors:

protected data:

- define the format:

      String format_d;

- define the language model scale factor:

      Float scale_d;

- define the symbol insertion penalty:

      Float penalty_d;

- define the n-symbol order:

      Long order_d;

- define the number of nodes in the graph:

      Long num_nodes_d;

- define the number of arcs in the graph:

      Long num_arcs_d;

- define the linked list of nodes corresponding to this graph:

      SingleLinkedList<SymbolGraphNode> nodes_d;

- define the start node and term nodes:

      SymbolGraphNode start_node_d;

      SymbolGraphNode term_node_d;

- declare the memory manager:

      static MemoryManager mgr_d;

- declare the debugging parameters:

      static Integral::DEBUG debug_level_d;

required public methods:

- static methods:

      static const String& name();

- debug methods:

      static boolean diagnose(Integral::DEBUG debug_level);

      static boolean setDebug(Integral::DEBUG debug_level);

- destructor/constructor(s):

      ~SymbolGraph();

      SymbolGraph();

      SymbolGraph(const SymbolGraph& copy_grp);

- assign methods:

      boolean assign(const SymbolGraph& copy_grp);

- operator= method:

      SymbolGraph& operator=(const SymbolGraph& arg);

- i/o methods:

      long sofSize() const;

      boolean read(Sof& sof, long tag, const String& cname = CLASS_NAME);

      boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);

      boolean write(Sof& sof, long tag, const String& cname = CLASS_NAME) const;

      boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;

- equality methods:

      boolean eq(const SymbolGraph& compare_graph) const;

- memory management methods:

      static void* operator new(size_t size);

      static void* operator new[](size_t size);

      static void operator delete(void* ptr);

      static void operator delete[](void* ptr);

      static boolean setGrowSize(long grow_size);

      boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);

class-specific public methods:

- declare class specific methods:

      boolean readDataText(Sof& sof_a, const String& pname, long size, boolean param, boolean nested);

      boolean readDataBinary(Sof& sof);

      boolean writeTextData(Sof& sof, const String& pname, Vector<Long>& nodes, Vector<Triple<Long, Long, String> >& symbols, Vector<Triple<Pair<Long, Long>, Float, Float> >& arcs) const;

      boolean writeBinaryData(Sof& sof, const String& pname, Vector<Long>& nodes, Vector<Triple<Long, Long, String> >& symbols, Vector<Triple<Pair<Long, Long>, Float, Float> >& arcs) const;

      boolean getFormat(String& arg);

      boolean setFormat(const String& arg);

      float getScale() const;

      boolean setScale(const float arg);

      float getPenalty() const;

      boolean setPenalty(const float arg);

      long getOrder() const;

      boolean setOrder(const long arg);

      SingleLinkedList<SymbolGraphNode>& getNodes();

      long getNumNodes() const;

      boolean setNumNodes(const long arg);

      long getNumArcs() const;

      boolean setNumArcs(const long arg);

      SymbolGraphNode* getStart();

      SymbolGraphNode* getTerm();

      boolean incrementNodes();

      boolean decrementNodes();

      boolean incrementArcs();

      boolean decrementArcs();

      boolean find(const SymbolGraphNode* obj);

      boolean contains(const SymbolGraphNode* obj);

      SymbolGraphNode* insertNode(long frame, const String& str = DEF_SYMBOL);

      boolean removeNode(SymbolGraphNode* obj);

      boolean prune();

      boolean compact(SymbolGraph& graph);

      boolean convert(SearchLevel& level, DiGraph<SearchNode>& digraph);

private methods:

- declare private methods:

      boolean get(Vector<Long>& nodes, Vector<Triple<Long, Long, String> >& symbols, Vector<Triple<Pair<Long, Long>, Float, Float> >& arcs);

      boolean set(Vector<Long>& nodes, Vector<Triple<Long, Long, String> >& symbols, Vector<Triple<Pair<Long, Long>, Float, Float> >& arcs);

      boolean readLatticeFormat(Sof& sof, const String& pname, long size, boolean param, boolean nested);

examples:

- none.

notes:

- none.