X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=TextCollection.h;h=ef0eb7210e57d4d72d8af50ac1be82097f6671c0;hb=9df50e6e5e58f746e83b9ad1d539024f82fa8b64;hp=e7e36e2cb635f74059b75cc93a45bf6174c77aa9;hpb=7d27a4450ed429e3b63e9d3ba7217a28cbbf9a31;p=SXSI%2FTextCollection.git diff --git a/TextCollection.h b/TextCollection.h index e7e36e2..ef0eb72 100644 --- a/TextCollection.h +++ b/TextCollection.h @@ -56,14 +56,16 @@ namespace SXSI * New samplerate can be given, otherwise will use the one specified in the save file! * Note: This is not a static method; call InitTextCollection() first to get the object handle. * - * Throws an exception if something goes wrong (unlikely since we are passing a file descriptor). + * Throws an exception if std::fread() fails. * */ virtual void Load(FILE *, unsigned samplerate = 0) = 0; /** * Save data structure into a file + * + * Throws an exception if std::fwrite() fails. */ - virtual void Save(FILE *) = 0; + virtual void Save(FILE *) const = 0; /** * Virtual destructor */ @@ -84,7 +86,13 @@ namespace SXSI * New texts can not be inserted after this operation. */ virtual void MakeStatic() = 0; - + + /** + tests if the string pointed to by DocId is empty + */ + + virtual bool EmptyText(DocId) const = 0; + /** * Displaying content * @@ -97,7 +105,7 @@ namespace SXSI * * Note: Parameters i and j are text positions inside the k'th text. */ - virtual uchar* GetText(DocId, TextPosition, TextPosition) const = 0; +// virtual uchar* GetText(DocId, TextPosition, TextPosition) const = 0; /** * Returns backwards (reverse) iterator to the end of i'th text * @@ -156,6 +164,12 @@ namespace SXSI typedef std::vector > full_result; virtual full_result FullContains(uchar const *) const = 0; + + /** + *Debug + * + */ + virtual TextPosition Lookup(TextPosition) const = 0; protected: // Protected constructor; call the static function InitTextCollection(). TextCollection() { };