Public Member Functions | |
reader (const char *filename) | |
Opens a database for retrieving strings. | |
virtual | ~reader () |
Destructs the database reader. | |
std::vector< std::string > | retrieve (const char *query) |
Retrieves strings that are similar to the query string. | |
void | close () |
Closes a database. | |
Data Fields | |
int | measure |
Similarity measure. | |
double | threshold |
Threshold for the similarity measure. |
reader::reader | ( | const char * | filename | ) |
Opens a database for retrieving strings.
This function creates an instance of SimString database reader by opening an existing database. If this function failes to open the database, it throws SWIG_IOError.
filename | The database filename. |
SWIG_IOError |
virtual reader::~reader | ( | ) | [virtual] |
Destructs the database reader.
Destructing the reader object automatically closes the database.
std::vector<std::string> reader::retrieve | ( | const char * | query | ) |
Retrieves strings that are similar to the query string.
This function retrieves strings whose similarity with the query string are no smaller than a threshold. Before calling this function, set the similarity measure and threshold to measure and threshold attributes of the reader object.
query | The query string. This argument must be a null-terminated byte stream. If the database was created with Unicode mode, this function assumes that the byte stream is encoded in UTF-8, and converts it into a wchar_t string. |
int reader::measure |
double reader::threshold |
Threshold for the similarity measure.
Specify a threshold for approximate string retrieval used by retrieve() function.