lxaGetDocumentCategories

<< lxaExplainConceptMatches | Back to Salience 6 C API Index | lxaGetDocumentClasses >>

Summary

Retrieves the categories for a document based on a predefined taxonomy, which can be tuned through additional data files.
The acConfigurationID parameter specifies the configuration for the results, which are returned in a SalienceTopicList structure. Configurations are defined using the method lxaAddSalienceConfiguration.
After use you should free the allocated memory by calling lxaFreeTopicList.

Syntax

int lxaGetDocumentCategories(SalienceSession *pSession, 
                             SalienceTopicList *pTopicList,
                             const char *acConfigurationID);

Parameters

pSession Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession
pTopicList Pointer to a SalienceTopicList structure
acConfigurationID Character string specifying the configuration for the results, blank for the default configuration

Returns

This function returns an integer return code.

Example

     lxaPrepareTextFromFile(pSession,acPath);          
     SalienceTopicList oCategories;
     lxaGetDocumentCategories(pSession,&oCategories);
     std::cout << "Document Categories: " << std::endl;

     for(int i = 0; i < oCategories.nLength; i++)
     {
          std::cout << "Category: " << oCategories.pTopics[i].acTopic << std::endl;
     }
     lxaFreeTopicList(&oCategories);

<< lxaExplainConceptMatches | Back to Salience 6 C API Index | lxaGetDocumentClasses >>