Document. More...
#include <gdoc.h>
Public Member Functions | |
GDoc (GSession *session, const R::RString &uri, const R::RString &title, const R::RString &desc, GLang *lang, const R::RString &mime, const R::RDate &u=R::RDate::GetToday()) | |
GDoc (GSession *session, const R::RString &uri, const R::RString &title, const R::RString &desc, size_t id, size_t blockid, size_t structid, GLang *lang, const R::RString &mime, size_t grpid, const R::RDate &c, const R::RDate &u, const R::RDate &a) | |
virtual R::RCString | GetClassName (void) const |
int | Compare (const GDoc &doc) const |
void | ReleaseTree (void) |
void | LoadTree (GConceptTree *&tree) const |
GConceptTree * | GetTree (void) const |
void | LoadTree (R::RContainer< GConceptRecord, false, true > &records, size_t &nbrecords, size_t &nbtoprecords, size_t &nbrefs) |
R::RString | GetTitle (void) const |
GLang * | GetLang (void) const |
R::RDate | GetUpdated (void) const |
R::RDate | GetComputed (void) const |
R::RString | GetMIMEType (void) const |
void | SetMIMEType (const R::RString &mime) |
R::RString | GetDescription (void) const |
bool | MustCompute (void) const |
R::RDate | GetAttached (void) const |
size_t | GetGroupId (void) const |
void | SetGroup (size_t groupid) |
size_t | GetStructId (void) const |
R::RNumCursor< size_t > | GetFdbks (void) const |
double | GetAgreementRatio (const GDoc *doc, size_t nbmin) const |
double | GetDisagreementRatio (const GDoc *doc, size_t nbmin) const |
size_t | GetNbFdbks (void) const |
void | SetUpdated (R::RDate &date) |
void | Update (GLang *lang, GDescription &desc, R::RContainer< GConceptRecord, false, true > &records, size_t nbrecords, size_t nbtoprecords, size_t nbrefs) |
virtual | ~GDoc (void) |
Public Member Functions inherited from GDescriptionObject< GDoc > | |
GDescriptionObject (GSession *session, size_t id, size_t blockid, tObjType objtype, const R::RString &name) | |
void | ReleaseVectors (void) |
const GDescription & | operator() (void) const |
R::RConstCursor< GVector > | GetVectors (void) const |
const GVector * | GetVector (GConcept *metaconcept) const |
bool | IsIn (const GConcept *concept) const |
bool | IsDefined (void) const |
tObjState | GetState (void) const |
size_t | GetId (void) const |
size_t | GetBlockId (void) const |
virtual | ~GDescriptionObject (void) |
Public Member Functions inherited from GObject | |
GObject (GSession *session, size_t id, const R::RString &name, tObjType type) | |
GObject (const GObject &obj) | |
void | VerifyStatements (tStatementElement what, size_t size) |
int | Compare (const GObject &obj) const |
int | Compare (size_t id) const |
int | Search (const GObject &obj) const |
int | Search (const R::RString &name) const |
GSession * | GetSession (void) const |
size_t | GetId (void) const |
void | SetId (size_t id) |
tObjType | GetObjType (void) const |
R::RCursor< GStatement > | GetObjs (const GStatement *obj, tStatementElement what) |
virtual void | HandlerNotFound (const R::RNotification ¬ification) |
virtual | ~GObject (void) |
Public Member Functions inherited from RObject | |
RObject (const RString &name=RString::Null) | |
int | Compare (const RObject &obj) const |
RString | GetName (void) const |
void | PostNotification (const hNotification handle) |
void | PostNotification (const RCString &name) |
void | PostNotification (const hNotification handle, T data) |
void | PostNotification (const RCString &name, T data) |
void | InsertObserver (tNotificationHandler handler, const hNotification handle, RObject *object) |
void | InsertObserver (tNotificationHandler handler, const RCString &name, RObject *object) |
void | InsertObserver (tNotificationHandler handler, const hNotification handle) |
void | InsertObserver (tNotificationHandler handler, const RCString &name) |
void | InsertObserver (tNotificationHandler handler, RObject *object) |
void | InsertObserver (tNotificationHandler handler) |
void | DeleteObserver (void) |
void | DeleteObserver (const hNotification handle, RObject *object) |
void | DeleteObserver (const RCString &name, RObject *object) |
hNotification | GetNotificationHandle (const RCString &name) const |
RCString | GetNotificationName (const hNotification handle) const |
virtual | ~RObject (void) |
Static Public Member Functions | |
static bool | HasTree (void) |
static tObjType | GetType (void) |
Static Public Member Functions inherited from GDescriptionObject< GDoc > | |
static bool | HasDesc (void) |
Static Public Member Functions inherited from GObject | |
static bool | HasDesc (void) |
static bool | HasTree (void) |
Private Member Functions | |
void | Clear (bool disk) |
void | SetTree (GConceptTree &tree) |
bool | InsertFdbk (size_t profileid) |
void | DeleteFdbk (size_t profileid) |
void | ClearFdbks (void) |
Private Attributes | |
R::RString | Title |
GLang * | Lang |
R::RString | MIMEType |
R::RDate | Updated |
R::RDate | Computed |
R::RNumContainer< size_t, true > * | Fdbks |
size_t | GroupId |
R::RDate | Attached |
size_t | StructId |
GConceptTree * | Tree |
R::RString | Description |
Additional Inherited Members | |
Protected Member Functions inherited from GDescriptionObject< GDoc > | |
virtual bool | LoadVectors (void) |
Protected Attributes inherited from GDescriptionObject< GDoc > | |
tObjState | State |
Protected Attributes inherited from GObject | |
GSession * | Session |
size_t | Id |
tObjType | ObjType |
R::RContainer< GStatement, false, true > * | Subjects |
R::RContainer< GStatement, false, false > * | Predicates |
R::RContainer< GStatement, false, false > * | Values |
Protected Attributes inherited from RObject | |
RString | Name |
Detailed Description
Document.
The GDoc class provides a representation of a analyzed document. In fact, a document is represented as a set of vectors and, eventually, its concept tree (the positions and the depths of each concept occurrence). In the tensor space model, the (hyper)links between documents are represented as a vector corresponding to concept category "link"
- Warning
- Since the concept tree is memory consuming, it is not associated with the document and must be managed by the developer.
Constructor & Destructor Documentation
GDoc | ( | GSession * | session, |
const R::RString & | uri, | ||
const R::RString & | title, | ||
const R::RString & | desc, | ||
GLang * | lang, | ||
const R::RString & | mime, | ||
const R::RDate & | u = R::RDate::GetToday() |
||
) |
Construct a new document.
- Parameters
-
session Session. uri URI of the document. title Title of the document. desc Description of the document. lang Language of the document. mime MIME type of the document. u Date of the last updated.
GDoc | ( | GSession * | session, |
const R::RString & | uri, | ||
const R::RString & | title, | ||
const R::RString & | desc, | ||
size_t | id, | ||
size_t | blockid, | ||
size_t | structid, | ||
GLang * | lang, | ||
const R::RString & | mime, | ||
size_t | grpid, | ||
const R::RDate & | c, | ||
const R::RDate & | u, | ||
const R::RDate & | a | ||
) |
Construct a document.
- Parameters
-
session Session. uri URI of the document. title Title of the document. desc Description of the document. id Identifier of the document. blockid Identifier of the block for the description. structid Identifier of the block for the structure. lang Language of the document. mime MIME type of the document. grpid Topic identifier. c Date of the last computation. u Date of the last updated. a Date of the last attached.
|
virtual |
Destruct the document.
Member Function Documentation
|
virtual |
- Returns
- the class name.
Reimplemented from GObject.
|
static |
Defines that the documents have concept trees.
- Returns
- true.
|
static |
Give the type of the object.
- Returns
- otDoc
int Compare | ( | const GDoc & | doc | ) | const |
Compare two documents by comparing their identifier.
- See also
- R::RContainer
- Parameters
-
doc Document.
- Returns
- int
void ReleaseTree | ( | void | ) |
Release the tree.
void LoadTree | ( | GConceptTree *& | tree | ) | const |
Load the concept tree of the document.
- Parameters
-
tree Reference to a pointer to the tree. If null, the tree is created.
GConceptTree* GetTree | ( | void | ) | const |
- Returns
- the concept tree (and load it if necessary).
void LoadTree | ( | R::RContainer< GConceptRecord, false, true > & | records, |
size_t & | nbrecords, | ||
size_t & | nbtoprecords, | ||
size_t & | nbrefs | ||
) |
Load the tree as a container of records.
- Parameters
-
records Container of records (modified by the method). nbrecords Number of records used for the document tree (modified by the method). nbtoprecords Number of top records (modified by the method). nbrefs Number of concepts referenced (modified by the method).
R::RString GetTitle | ( | void | ) | const |
Get the Title.
- Returns
- the title.
GLang* GetLang | ( | void | ) | const |
- Returns
- Pointer to the Language.
R::RDate GetUpdated | ( | void | ) | const |
Get the date of the last update of the document content.
- Returns
- the date.
R::RDate GetComputed | ( | void | ) | const |
Get the date of the last analysis of the document.
- Returns
- the date.
R::RString GetMIMEType | ( | void | ) | const |
Get the MIME type of the document.
- Returns
- String.
void SetMIMEType | ( | const R::RString & | mime | ) |
Set the MIME type of the document.
- Parameters
-
mime C String representing the MIME type.
R::RString GetDescription | ( | void | ) | const |
Get the description of the document.
- Returns
- String.
bool MustCompute | ( | void | ) | const |
Verify if the document must be (re-)computed.
R::RDate GetAttached | ( | void | ) | const |
Get the date of the last attachment.
- Returns
- the date.
size_t GetGroupId | ( | void | ) | const |
Get the topic holding the document.
void SetGroup | ( | size_t | groupid | ) |
Set the topic holding the document.
- Parameters
-
groupid Identifier of the topic.
size_t GetStructId | ( | void | ) | const |
Get the identifier of the block containing the structure. If null, it means that the object is not defined.
- Returns
- Identifier of the block.
R::RNumCursor<size_t> GetFdbks | ( | void | ) | const |
- Returns
- a cursor on the identifier of the profiles which have assesses the document.
double GetAgreementRatio | ( | const GDoc * | doc, |
size_t | nbmin | ||
) | const |
Compute the agreement ratio between two documents, i.e. the ratio between the number of profiles assessing them as relevant, and the total number of profiles assessing them.
- Parameters
-
doc Second document. nbmin Minimum number of common profiles for a non null ratio.
double GetDisagreementRatio | ( | const GDoc * | doc, |
size_t | nbmin | ||
) | const |
Compute the disagreement ratio between two documents, i.e. the ratio between the number of profiles assessing them one as relevant and the other one differently by the other one, and the total number of profiles assessing them.
- Parameters
-
doc Second document. nbmin Minimum number of common profiles for a non null ratio.
size_t GetNbFdbks | ( | void | ) | const |
Get the number of times the documents was assessed.
void SetUpdated | ( | R::RDate & | date | ) |
Set the date of the last update of the document content.
- Parameters
-
doc Document updated. date Date of the update.
|
private |
Clear the concept tree and the vectors associated with the document.
- Parameters
-
disk Clear the reference to the corresponding block on disk.
|
private |
Associate a concept tree with a document.
The method is only called by GDocAnalyze to associate a tree to a document loaded into memory but not in the storage.
- Parameters
-
tree Tree to associate.
|
private |
Add a profile to the list of those which have assess the document.
- Parameters
-
profileid Identifier of the profile.
- Returns
- true if it is a new feedback.
|
private |
Delete a profile from the list of those which have assess the document.
- Parameters
-
profileid Identifier of the profile.
|
private |
Clear all the assessments on the document.
void Update | ( | GLang * | lang, |
GDescription & | desc, | ||
R::RContainer< GConceptRecord, false, true > & | records, | ||
size_t | nbrecords, | ||
size_t | nbtoprecords, | ||
size_t | nbrefs | ||
) |
Update the representation of the document once a computation was done. The computed date and the status are updated.
If the document is an internal one, the following steps are done:
- An 'hDocs[oeAboutToUpdated]' notification is send.
- The references are updated.
- Existing in memory description and tree are replaced.
- If necessary, the document, its description and its tree are saved.
- An 'hDocs[oeUpdated]' notification is send.
If the document is an external one, its description and tree are replaced.
- Parameters
-
lang Language to assign. desc Description to assign. records Container of records. nbrecords Number of records used for the document tree. nbtoprecords Number of top records. nbrefs Number of concepts referenced.
- Warning
- The description is cleared by this method. This method must be used with caution because it can corrupt the whole database.
Member Data Documentation
|
private |
Title of the document.
|
private |
Language of the description.
|
private |
MIME Type of the document.
|
private |
Date of last update of document content.
|
private |
Date of last document computation.
|
private |
Identifiers of the profiles which have assessed the document.
|
private |
Identifiers of the corresponding topic.
|
private |
Date of the attachment of the document into the topic.
|
private |
Block identifier of the struct.
|
private |
Tree representing the document.
|
private |
Description of the document.