Concept. More...

#include <gconcept.h>

Inheritance diagram for GConcept:
[legend]

List of all members.

Public Member Functions

 GConcept (const GConcept *concept)
 GConcept (GSession *session, const R::RString &name, GConceptType *type)
 GConcept (GSession *session, size_t id, const R::RString &name, GConceptType *type, size_t refdocs, size_t idxdocs, size_t refprofiles, size_t idxprofiles, size_t refcommunities, size_t idxcommunities, size_t reftopics, size_t idxtopics, size_t refclasses, size_t idxclasses)
int Compare (const GConcept &c) const
int Compare (const R::RString &name) const
virtual tObjType GetObjType (void) const
virtual GConceptDeepCopy (void) const
virtual size_t HashIndex (size_t idx) const
GConceptTypeGetType (void) const
void SetId (size_t id)
size_t GetIndex (tObjType ObjType) const
void SetIndex (tObjType ObjType, size_t index)
void ClearIndex (tObjType type)
size_t IncRef (tObjType ObjType)
size_t DecRef (tObjType ObjType)
virtual void ClearRefs (tObjType ObjType)
size_t GetRef (tObjType ObjType) const
double GetIF (tObjType ObjType) const
virtual void Clear (void)
virtual bool IsEmpty (void) const
virtual ~GConcept (void)

Protected Attributes

GConceptTypeType
size_t NbRefDocs
double IfDocs
size_t IndexDocs
size_t NbRefProfiles
double IfProfiles
size_t IndexProfiles
size_t NbRefCommunities
double IfCommunities
size_t IndexCommunities
size_t NbRefTopics
double IfTopics
size_t IndexTopics
size_t NbRefClasses
double IfClasses
size_t IndexClasses

Detailed Description

Concept.

The GConcept class provides a representation for a generic concept. A concept is a "representation" of a given piece of knowledge.

Author:
Pascal Francq

Constructor & Destructor Documentation

GConcept ( const GConcept concept)

Copy constructor.

Parameters:
conceptOriginal concept.
GConcept ( GSession session,
const R::RString name,
GConceptType type 
)

Constructor of a generic concept.

Parameters:
sessionSession.
nameName of the concept.
typeType of the concept.
GConcept ( GSession session,
size_t  id,
const R::RString name,
GConceptType type,
size_t  refdocs,
size_t  idxdocs,
size_t  refprofiles,
size_t  idxprofiles,
size_t  refcommunities,
size_t  idxcommunities,
size_t  reftopics,
size_t  idxtopics,
size_t  refclasses,
size_t  idxclasses 
)

Constructor of a generic concept.

Parameters:
sessionSession.
idIdentifier.
nameName of the concept.
typeType of the concept.
refdocsNumber of documents referenced.
idxdocsIdentifier of the block the inverted file related to the documents.
refprofilesNumber of profiles referenced.
idxprofilesIdentifier of the block the inverted file related to the profiles.
refcommunitiesNumber of communities referenced.
idxcommunitiesIdentifier of the block the inverted file related to the communities.
reftopicsNumber of topics referenced.
idxtopicsIdentifier of the block the inverted file related to the topics.
refclassesNumber of classes referenced.
idxclassesIdentifier of the block the inverted file related to the classes.
virtual ~GConcept ( void  ) [virtual]

Destruct the concept.


Member Function Documentation

int Compare ( const GConcept c) const

Compare two concepts.

Parameters:
cConcept used.
See also:
R::RContainer
int Compare ( const R::RString name) const

Compare a concept with a given name.

Parameters:
nameName.
See also:
R::RContainer
virtual tObjType GetObjType ( void  ) const [virtual]
Returns:
the type of the object.

Reimplemented from GObject.

virtual GConcept* DeepCopy ( void  ) const [virtual]

Do a deep copy of the current concept.

Returns:
Pointer to a new element created.

Reimplemented in GConceptList.

virtual size_t HashIndex ( size_t  idx) const [virtual]

Compute the first hash index of the name of a concept.

See also:
R::RHashContainer
Parameters:
idxIndex of the hash index.
GConceptType* GetType ( void  ) const

Get the type of the concept.

void SetId ( size_t  id)

Set the Identifier of the concept.

Parameters:
idIdentifier.

Reimplemented from GObject.

size_t GetIndex ( tObjType  ObjType) const
Returns:
the block index of the concept for a given object type.
Parameters:
ObjTypeType of the reference.
void SetIndex ( tObjType  ObjType,
size_t  index 
)

Set the block index of the concept for a given object type.

Parameters:
ObjTypeType of the reference.
indexIndex to set.
void ClearIndex ( tObjType  type)

Clear the block index of the concept for a given object type.

Parameters:
ObjTypeType of the reference.
size_t IncRef ( tObjType  ObjType)

Increase the number of references on this concept for a given object type.

Parameters:
ObjTypeType of the reference.
size_t DecRef ( tObjType  ObjType)

Decrease the number of references on this concept for a given object type.

Parameters:
ObjTypeType of the reference.
virtual void ClearRefs ( tObjType  ObjType) [virtual]

Clear the information of the references of the concept linked to a specific object.

Parameters:
ObjTypeType of the object.
size_t GetRef ( tObjType  ObjType) const

Get the number of references on this concept for a given object type.

Parameters:
ObjTypeType of the reference. If otAnyType, the method returns the number of references of all the objects.
Returns:
size_t.
double GetIF ( tObjType  ObjType) const

Compute the inverse factor of the concept for a given object type (such as the 'idf' for documents). In practice, the factor is computed once.

Returns:
Inverse factor
Parameters:
ObjTypeType of the reference.
virtual void Clear ( void  ) [virtual]

Clear all the information of the concept.

Reimplemented in GConceptList.

virtual bool IsEmpty ( void  ) const [virtual]

Test if the concept is considered as empty. By default, every concept defined by a non-empty name, is also considered as not empty.

Reimplemented in GConceptList.


Member Data Documentation

GConceptType* Type [protected]

Type of the concept.

size_t NbRefDocs [protected]

Number of references in documents.

double IfDocs [protected]

Inverse factor for documents.

size_t IndexDocs [protected]

Identifier of the block in the inverted file for the documents.

size_t NbRefProfiles [protected]

Number of references in profiles.

double IfProfiles [protected]

Inverse factor for profiles.

size_t IndexProfiles [protected]

Identifier of the block in the inverted file for the profiles.

size_t NbRefCommunities [protected]

Number of references in communities.

double IfCommunities [protected]

Inverse factor for communities.

size_t IndexCommunities [protected]

Identifier of the block in the inverted file for the communities.

size_t NbRefTopics [protected]

Number of references in topics.

double IfTopics [protected]

Inverse factor for topics.

size_t IndexTopics [protected]

Identifier of the block in the inverted file for the topics.

size_t NbRefClasses [protected]

Number of references in classes.

double IfClasses [protected]

Inverse factor for classes.

size_t IndexClasses [protected]

Identifier of the block in the inverted file for the classes.