lxaGetNamedEntities

<< lxaGetIntentions | Back to Salience 6 C API Index | lxaGetNamedEntityRelationships >>

Summary

Retrieves the entities from text based on model-based or datafile-based entity extraction. Parameters to control entity extraction should be specified by setting Entity Options.
The acConfigurationID parameter specifies the configuration for the results, which are returned in a SalienceEntityList structure. Configurations are defined using the method lxaAddSalienceConfiguration.
After use you should free the allocated memory by calling lxaFreeEntityList.

Syntax

int lxaGetNamedEntities(SalienceSession *pSession, 
                        SalienceEntityList *pResults,
                        const char *acConfigurationID);

Parameters

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

Returns

LXA_OK Entity extraction completed successfully.
LXA_OK_WITH_WARNINGS There was a non-fatal issue with entity extraction. Use lxaGetLastWarnings to determine the cause of the warning.

Example

    char* acPath = "c:/somefile.txt";
    SalienceEntityList oEntityList;
    SalienceEntityParams oParams;
    SalienceSession* pSession;
    ... //Set up the parameters as well as the license here
    if (lxaOpenSalienceSession(oLicense,acDataPath,&pSession,&acError) == LXA_OK)
    {
        lxaPrepareTextFromFile(pSession,acPath);
        lxaGetNamedEntities(pSession,&oEntityList);
        ...
        lxaFreeEntityList(&oEntityList);
        lxaCloseSalienceSession(pSession);
    }

<< lxaGetIntentions | Back to Salience 6 C API Index | lxaGetNamedEntityRelationships >>