Reranker Framework (ReFr)
Reranking framework for structure prediction and discriminative language modeling
|
A symbol table that stores the mapping from symbols to int
’s and vice versa in local (non-static) data structures.
More...
#include <symbol-table.H>
Public Member Functions | |
virtual const_iterator | begin () |
virtual const_iterator | end () |
virtual size_t | size () const |
Returns the number of symbols in this table. More... | |
virtual int | GetIndex (const string &symbol) |
Returns the unique index for the specified symbol. More... | |
virtual const string & | GetSymbol (int index) const |
Returns the unique symbol for the specified index, or the empty string if the specified index does not map to any symbol in this symbol table. More... | |
virtual void | SetIndex (const string &symbol, int index) |
virtual void | Clear () |
Clears all symbols from this symbol table. More... | |
virtual Symbols * | Clone () const |
Creates a newly-constructed clone of this Symbols instance that has the same runtime type. More... | |
virtual ostream & | Output (ostream &os) |
Outputs the symbol table to the specified output stream in a simple format, one symbol-to-index mapping per line: More... | |
Public Member Functions inherited from reranker::Symbols | |
virtual | ~Symbols () |
Additional Inherited Members | |
Public Types inherited from reranker::Symbols | |
typedef unordered_map< string, int >::const_iterator | const_iterator |
Static Protected Attributes inherited from reranker::Symbols | |
static string | null_symbol |
A symbol table that stores the mapping from symbols to int
’s and vice versa in local (non-static) data structures.
Definition at line 185 of file symbol-table.H.
|
inlinevirtual |
Implements reranker::Symbols.
Definition at line 187 of file symbol-table.H.
|
inlinevirtual |
Clears all symbols from this symbol table.
Implements reranker::Symbols.
Definition at line 216 of file symbol-table.H.
|
inlinevirtual |
Creates a newly-constructed clone of this Symbols instance that has the same runtime type.
The caller will be responsible for destroying the returned instance.
Implements reranker::Symbols.
Definition at line 222 of file symbol-table.H.
|
inlinevirtual |
Implements reranker::Symbols.
Definition at line 188 of file symbol-table.H.
|
virtual |
Returns the unique index for the specified symbol.
symbol | the symbol whose index is to be retrieved |
Implements reranker::Symbols.
Definition at line 74 of file symbol-table.C.
|
virtual |
Returns the unique symbol for the specified index, or the empty string if the specified index does not map to any symbol in this symbol table.
Implements reranker::Symbols.
Definition at line 87 of file symbol-table.C.
|
inlinevirtual |
Outputs the symbol table to the specified output stream in a simple format, one symbol-to-index mapping per line:
where
os | the output stream to which to output the symbol table |
Implements reranker::Symbols.
Definition at line 227 of file symbol-table.H.
|
inlinevirtual |
Implements reranker::Symbols.
Definition at line 201 of file symbol-table.H.
|
inlinevirtual |
Returns the number of symbols in this table.
Implements reranker::Symbols.
Definition at line 191 of file symbol-table.H.