FreeLing  3.0
Public Member Functions | Private Attributes
database Class Reference

Class to wrap a berkeley DB database and unify access. More...

#include <database.h>

Inheritance diagram for database:
Inheritance graph
[legend]
Collaboration diagram for database:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 database (int)
 constructor
 database (const std::wstring &)
 constructor
virtual ~database ()
 destructor
void add_database (const std::wstring &, const std::wstring &)
 add a new pair (key, data) to the database
std::wstring access_database (const std::wstring &) const
 search for a string key in the DB, return associated string data.

Private Attributes

int DBtype
 DB type (map, hash_map, preftree)
std::map< std::wstring,
std::wstring > 
dbmap
 Dictionary for map type.
PrefTree dbptree
 Dictionary for hash_map type.

Detailed Description

Class to wrap a berkeley DB database and unify access.

All databases in Freeling use a string key to index string data.


Constructor & Destructor Documentation

database::database ( int  type)

constructor

Create an empty database of given type.

database::database ( const std::wstring &  )

constructor

virtual database::~database ( ) [inline, virtual]

destructor


Member Function Documentation

wstring database::access_database ( const std::wstring &  ) const

search for a string key in the DB, return associated string data.

References DB_MAP, and DB_PREFTREE.

Referenced by punts::analyze(), and punts::punts().

void database::add_database ( const std::wstring &  ,
const std::wstring &   
)

add a new pair (key, data) to the database

add a new pair (key, data) to the database, or if 'key' already exists, concatenate 'data' to the existing entry

References DB_MAP, and DB_PREFTREE.


Member Data Documentation

std::map<std::wstring,std::wstring> database::dbmap [private]

Dictionary for map type.

Dictionary for hash_map type.

Dictionary for pref tree type

int database::DBtype [private]

DB type (map, hash_map, preftree)


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