Reranker Framework (ReFr)
Reranking framework for structure prediction and discriminative language modeling
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
reranker::LocalSymbolTable Class Reference

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>

Inheritance diagram for reranker::LocalSymbolTable:
reranker::Symbols

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 SymbolsClone () 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
 

Detailed Description

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.

Member Function Documentation

virtual const_iterator reranker::LocalSymbolTable::begin ( )
inlinevirtual

Implements reranker::Symbols.

Definition at line 187 of file symbol-table.H.

virtual void reranker::LocalSymbolTable::Clear ( )
inlinevirtual

Clears all symbols from this symbol table.

Implements reranker::Symbols.

Definition at line 216 of file symbol-table.H.

virtual Symbols* reranker::LocalSymbolTable::Clone ( ) const
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.

Returns
a clone of this Symbols instance that has the same runtime type

Implements reranker::Symbols.

Definition at line 222 of file symbol-table.H.

virtual const_iterator reranker::LocalSymbolTable::end ( )
inlinevirtual

Implements reranker::Symbols.

Definition at line 188 of file symbol-table.H.

int reranker::LocalSymbolTable::GetIndex ( const string &  symbol)
virtual

Returns the unique index for the specified symbol.

Parameters
symbolthe symbol whose index is to be retrieved

Implements reranker::Symbols.

Definition at line 74 of file symbol-table.C.

const string & reranker::LocalSymbolTable::GetSymbol ( int  index) const
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.

virtual ostream& reranker::LocalSymbolTable::Output ( ostream &  os)
inlinevirtual

Outputs the symbol table to the specified output stream in a simple format, one symbol-to-index mapping per line:

<symbol> <tab> <index>

where

<symbol> ::= an indexed string symbol
<tab> ::= a tab character, '\t'
<index> ::= a unique integer for <symbol>
Parameters
osthe output stream to which to output the symbol table
Returns
the specified output stream

Implements reranker::Symbols.

Definition at line 227 of file symbol-table.H.

virtual void reranker::LocalSymbolTable::SetIndex ( const string &  symbol,
int  index 
)
inlinevirtual

Implements reranker::Symbols.

Definition at line 201 of file symbol-table.H.

virtual size_t reranker::LocalSymbolTable::size ( ) const
inlinevirtual

Returns the number of symbols in this table.

Implements reranker::Symbols.

Definition at line 191 of file symbol-table.H.


The documentation for this class was generated from the following files: