An interface specifying a converter from symbols (strings) to int indices.
More...
#include <symbol-table.H>
|
virtual | ~Symbols () |
|
virtual const_iterator | begin ()=0 |
|
virtual const_iterator | end ()=0 |
|
virtual size_t | size () const =0 |
| Returns the number of symbols in this table. More...
|
|
virtual int | GetIndex (const string &symbol)=0 |
| Converts the specified symbol to a unique integer. More...
|
|
virtual const string & | GetSymbol (int index) const =0 |
| 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)=0 |
|
virtual void | Clear ()=0 |
| Clears all symbols from this symbol table. More...
|
|
virtual Symbols * | Clone () const =0 |
| Creates a newly-constructed clone of this Symbols instance that has the same runtime type. More...
|
|
virtual ostream & | Output (ostream &os)=0 |
| Outputs the symbol table to the specified output stream in a simple format, one symbol-to-index mapping per line: More...
|
|
An interface specifying a converter from symbols (strings) to int indices.
Definition at line 57 of file symbol-table.H.
virtual reranker::Symbols::~Symbols |
( |
| ) |
|
|
inlinevirtual |
virtual void reranker::Symbols::Clear |
( |
| ) |
|
|
pure virtual |
virtual Symbols* reranker::Symbols::Clone |
( |
| ) |
const |
|
pure virtual |
virtual int reranker::Symbols::GetIndex |
( |
const string & |
symbol | ) |
|
|
pure virtual |
Converts the specified symbol to a unique integer.
The behavior of this class is undefined if the specified symbol is the empty string.
- Parameters
-
symbol | the symbol to convert |
- Returns
- a unique integer for the specified symbol
Implemented in reranker::LocalSymbolTable, and reranker::StaticSymbolTable.
virtual const string& reranker::Symbols::GetSymbol |
( |
int |
index | ) |
const |
|
pure virtual |
virtual ostream& reranker::Symbols::Output |
( |
ostream & |
os | ) |
|
|
pure virtual |
Outputs the symbol table to the specified output stream in a simple format, one symbol-to-index mapping per line:
where
<symbol> ::= an indexed string symbol
<tab> ::= a tab character, '\t'
<index> ::= a unique integer for <symbol>
- Parameters
-
os | the output stream to which to output the symbol table |
- Returns
- the specified output stream
Implemented in reranker::LocalSymbolTable, and reranker::StaticSymbolTable.
virtual void reranker::Symbols::SetIndex |
( |
const string & |
symbol, |
|
|
int |
index |
|
) |
| |
|
pure virtual |
virtual size_t reranker::Symbols::size |
( |
| ) |
const |
|
pure virtual |
string reranker::Symbols::null_symbol |
|
staticprotected |
The documentation for this class was generated from the following files: