lxaGetConceptDefinedTopics

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

Summary

Retrieves the topics determined for the text via the Salience 6 Concept Matrix. Before calling this method, you must specify a concept topic list using the Concept Topic List option.
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 lxaGetConceptDefinedTopics(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

     SalienceOption oOption;
     oOption.nOption = SALIENCEOPTION_CONCEPTTOPICLIST;
     oOption.acValue = "/path/to/concept/topic/list";
     lxaSetSalienceOption(pSession,&oOption);

     lxaPrepareTextFromFile(pSession,acPath);          
     SalienceTopicList oTopicList;
     lxaGetConceptDefinedTopics(pSession,&oTopicList);
     std::cout << "Concept Topics: " << std::endl;

     for(int i = 0; i < oTopicList.nLength; i++)
     {
          std::cout << "Topic: " << oTopicList.pTopics[i].acTopic << std::endl;
          std::cout << "\tTopic Sentiment: " << oTopicList.pTopics[i].fSentiment << std::endl;
          std::cout << "\tHit(s): " << oTopicList.pTopics[i].nHits << "\n" << std::endl;
     }
     lxaFreeTopicList(&oTopicList);

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