Salience.GetSummary

<< Salience.GetDocumentDetails | Back to Salience 6 .Net Index | Salience.GetDocumentSentiment >>

Summary

Returns an object containing summary results for the document.
The id parameter is an optional parameter to specify which configuration to return results for. Content can be processed by multiple configurations in one pass by prior calls to Salience.AddSalienceConfiguration. Omitting this parameter or passing an empty string returns results based on the default configuration.
This method is a wrapper around the underlying C API method lxaGetSummary.

Syntax

public SalienceSummary GetSummary(int nLength, String id="")

Parameters

nLength Length of the summary in number of sentences
id Optional: The identifier for a specific configuration for results.

Returns

If successful, a SalienceSummary object is returned. Otherwise, an exception is thrown with information about the failure.

Example

    Salience Engine = null;
    string licensePath = "C:/Program Files/Lexalytics/License.v5";
    string dataPath = "C:/Program Files/Lexalytics/data";

    try
    {
        Engine = new Salience(licensePath, dataPath);
    }
    catch (SalienceException e)
    {
        System.Console.WriteLine("Error Loading SalienceEngine: " + e.Message);
        return;
    }

    int nRet = Engine.PrepareTextFromFile("path\to\file");
    if (nRet==0)
    {
        SalienceSummary mySummary = new SalienceSummary();        
        mySummary = Engine.GetSummary(3, String.Empty);
        System.Console.WriteLine(mySummary.sSummary);
        ....
    }

<< Salience.GetDocumentDetails | Back to Salience 6 .Net Index | Salience.GetDocumentSentiment >>