NERsuite  1.1.1
Public Member Functions | Public Attributes
NER::Dictionary Class Reference

#include <dictionary.h>

List of all members.

Public Member Functions

 Dictionary (const char *binary_dbname)
virtual ~Dictionary ()
void open ()
const int * get_classes (const std::string &key, int normalize_type, size_t *count) const
size_t get_class_count () const
const std::string & get_class_name (int class_index) const
void build (const char *txt_dbname, int normalize_type)

Public Attributes

const std::string db_path

Detailed Description

External Dictionary Manager Class


Constructor & Destructor Documentation

NER::Dictionary::Dictionary ( const char *  binary_dbname)

Construct a Dictionary object. The path to the CDBPP database file must be provided.

Parameters:
[in]binary_dbnamePath to the CDBPP database.
NER::Dictionary::~Dictionary ( ) [virtual]

Destroy a Dictionary object.


Member Function Documentation

void NER::Dictionary::build ( const char *  txt_dbname,
int  normalize_type 
)

Build up a new CDBPP Dictionary from a text file.

Parameters:
[in]txt_dbnamePath to an existing text file to be read as the Dictionary source.
[in]normalize_typeA combination of normalization types which is applied to parse the surface of input Dictioanry entries.
size_t NER::Dictionary::get_class_count ( ) const

Retrieve the count of Classes this Dictionary contains.

Precondition:
The Dictionary must be open before calling this function.
Returns:
Size of the Class set.
const string & NER::Dictionary::get_class_name ( int  class_index) const

Convert a Class index to its name.

Precondition:
The Dictionary must be open before calling this function.
Parameters:
[in]class_indexIndex of a class (must be smaller than the value returned from get_class_count)
Returns:
Name of the class
const int * NER::Dictionary::get_classes ( const std::string &  key,
int  normalize_type,
size_t *  count 
) const

Retrieve the array of Classes which match the provided key from the Database.

Precondition:
The Dictionary must be open before calling this function.
Parameters:
[in]keyKey string
[in]normalize_typeCombination of all normalization which should be applied before key matching
[out]countMatch count
Returns:
Returns an array of all class indices which satisfy the given condition
void NER::Dictionary::open ( )

Open the Dictionary for reading.


Member Data Documentation

const std::string NER::Dictionary::db_path

Path to the CDBPP Database File (Read only)


The documentation for this class was generated from the following files:
 All Classes Functions Variables