simstring::ngramdb_reader_base< value_tmpl > Class Template Reference


Detailed Description

template<class value_tmpl>
class simstring::ngramdb_reader_base< value_tmpl >

A reader for an n-gram database.

Parameters:
value_tmpl The value type. This is required to be an integer type.


Public Types

typedef value_tmpl value_type
 The type of a value.

Public Member Functions

 ngramdb_reader_base ()
 Constructs an object.
virtual ~ngramdb_reader_base ()
 Destructs an object.
bool fail () const
 Checks whether an error has occurred.
std::string error () const
 Returns an error message.
void open (const std::string &name, int max_size)
 Opens an n-gram database.
void close ()
 Closes an n-gram database.
template<class measure_type, class query_type>
void overlapjoin (const query_type &query, double alpha, results_type &results)
 Performs an overlap join on inverted lists retrieved for the query.

Protected Member Functions

hashtbl_type & open_index (const std::string &base, int size)
 Open the index storing strings of the specific size.


Member Function Documentation

template<class value_tmpl>
bool simstring::ngramdb_reader_base< value_tmpl >::fail (  )  const [inline]

Checks whether an error has occurred.

Returns:
bool true if an error has occurred.

template<class value_tmpl>
std::string simstring::ngramdb_reader_base< value_tmpl >::error (  )  const [inline]

Returns an error message.

Returns:
std::string The string of the error message.

template<class value_tmpl>
void simstring::ngramdb_reader_base< value_tmpl >::open ( const std::string &  name,
int  max_size 
) [inline]

Opens an n-gram database.

Parameters:
name The name of the database.
max_size The maximum size of the strings.

template<class value_tmpl>
template<class measure_type, class query_type>
void simstring::ngramdb_reader_base< value_tmpl >::overlapjoin ( const query_type &  query,
double  alpha,
results_type &  results 
) [inline]

Performs an overlap join on inverted lists retrieved for the query.

Parameters:
query The query object that stores query n-grams, threshold, and conditions for the similarity measure.
results The SIDs that satisfies the overlap join.

template<class value_tmpl>
hashtbl_type& simstring::ngramdb_reader_base< value_tmpl >::open_index ( const std::string &  base,
int  size 
) [inline, protected]

Open the index storing strings of the specific size.

Parameters:
base The base name of the indices.
size The size of strings.
Returns:
hashtbl_type& The hash table of the index.


Copyright (c) 2002-2010 by Naoaki Okazaki
Sun Mar 7 18:17:17 2010