prepareCollectionFromFile

<< prepareCollectionFromList | Back to Salience 6 python Index | getDocumentDetails >>

Summary

Prepares the contents of a file for collection processing. This function, or its sister function prepareCollectionFromList, must be called every time you want to process a different set of related pieces of text. The file must consist of individual strings that are either 7bit ASCII or UTF8.
This method provides a wrapper around the underlying C API method lxaPrepareCollectionFromFile.

Syntax

salience6.prepareCollectionFromFile(oSession, sName, sPath)

Parameters

oSession A SalienceSession object previously created via openSession
sName A descriptive name for the collection
sPath A text file containing a list of text strings to process as a collection of related content

Returns

Returns an integer return code. Possible error return codes are specified on the Errors and Warning Codes page.

Example

    import salience6 as se6
    session = se6.openSession('/path/to/license.v5','/path/to/data')
    ret = se6.prepareCollectionFromList(session, 'myCollection', '/path/to/aFile.txt')
    if (ret==0):
        ...extract results from text...
    else:
        if (ret==6):
            print se6.getLastWarnings(session)     
    se6.closeSession(session)

<< prepareCollectionFromList | Back to Salience 6 python Index | getDocumentDetails >>