Public Member Functions | |
| writer (const char *filename, int n=3, bool be=false, bool unicode=false) | |
| Creates a new database. | |
| virtual | ~writer () |
| Destructs the writer. | |
| void | insert (const char *string) |
| Inserts a string into the database. | |
| void | close () |
| Closes the database. | |
| writer::writer | ( | const char * | filename, | |
| int | n = 3, |
|||
| bool | be = false, |
|||
| bool | unicode = false | |||
| ) |
Creates a new database.
This function creates an instance of SimString database writer for creating a new database. If this function failes to open the database, it throws SWIG_IOError.
| filename | The database filename. | |
| n | The unit of character n-grams. | |
| be | true to represent a begin and end of strings in character n-grams. | |
| unicode | true to use Unicode mode. In Unicode mode, wide (wchar_t) characters are used in n-grams. |
| SWIG_IOError |
| virtual writer::~writer | ( | ) | [virtual] |
Destructs the writer.
Destructing a writer object automatically closes the database.
| SWIG_IOError |
| void writer::insert | ( | const char * | string | ) |
Inserts a string into the database.
| string | A string to be inserted to the database. This argument must be a null-terminated byte stream. If the database is created with Unicode mode, this function assumes that the byte stream is encoded in UTF-8, and converts it into a wchar_t string. |
| SWIG_IOError |
| void writer::close | ( | ) |
Closes the database.
This function flushes and closes the database. If this function failes to close the database, it throws SWIG_IOError.
| SWIG_IOError |