<< addSectionFromFile | Back to Salience 6 python Index | prepareCollectionFromFile >>


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


salience6.prepareCollectionFromList(oSession, sName, lstContent)


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


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


    import salience6 as se6
    session = se6.openSession('/path/to/license.v5','/path/to/data')
    # Prepare the collection
    content = []
    content.append("The cruise was excellent and service was great.")
    content.append("I found the temperature in the dining rooms very cold.")
    ret = se6.prepareCollectionFromList(session, 'myCollection', content)
    if (ret==0):
        ...extract results from text...
        if (ret==6):
            print se6.getLastWarnings(session)     

<< addSectionFromFile | Back to Salience 6 python Index | prepareCollectionFromFile >>