lxaPrepareCollectionFromFile

<< lxaPrepareCollection | Back to Salience 6 C API Index | lxaGetDocumentDetails >>

Summary

Prepares the contents of a file as a collection for processing. This function, or its sister function lxaPrepareCollection, must be called every time you want to process a different set of related pieces of text. The contents of the file are expected to be 7bit ASCII or UTF8.

Syntax

int lxaPrepareCollectionFromFile(SalienceSession* pSession, 
                                 const char* acCollectionName, 
                                 const char* acFile);

Parameters

pSession Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession
acCollectionName Pointer to a null-terminated string containing a descriptive name for the collection
acFile Pointer to a null-terminated string containing the path to the file you want to process

Returns

This function returns an integer return code. The most common return codes are shown below, see the Errors and Warning Codes page for other error return codes.
LXA_OK Text preparation was successful
LXA_OK_WITH_WARNINGS The text is malformed in some way. You should call lxaGetLastWarnings to find out the specifics of the warning.

Comments

TODO: insert information about structure of valid file for use with lxaPrepareCollectionFromFile

Example

     char* acPath = "/path/to/content";
     ...
     SalienceSession* pSession;
     if(lxaOpenSalienceSession(oLicense, &oStartup, &pSession) != LXA_OK)
          return 1;
     SalienceCollection oCollection;
     oCollection.nSize = 1;
     oCollection.acCollectionName = "MyCollection";

     if(lxaPrepareCollectionFromFile(pSession,oCollection.acCollectionName,acPath) != LXA_OK);
          return 1;
     ...

<< lxaPrepareCollection | Back to Salience 6 C API Index | lxaGetDocumentDetails >>