|
FreeLing
3.0
|
Class to wrap a berkeley DB database and unify access. More...
#include <database.h>


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. | |
Class to wrap a berkeley DB database and unify access.
All databases in Freeling use a string key to index string data.
| database::database | ( | int | type | ) |
constructor
Create an empty database of given type.
| database::database | ( | const std::wstring & | ) |
constructor
| virtual database::~database | ( | ) | [inline, virtual] |
destructor
| 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.
std::map<std::wstring,std::wstring> database::dbmap [private] |
Dictionary for map type.
PrefTree database::dbptree [private] |
Dictionary for hash_map type.
Dictionary for pref tree type
int database::DBtype [private] |
DB type (map, hash_map, preftree)
1.7.6.1