Salience.GetDocumentThemes

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

Summary

Returns a list of themes 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 a wrapper around the underlying C API method lxaGetThemes.

Syntax

public List<SalienceTheme> GetDocumentThemes(String id="")

Parameters

id Optional: The identifier for a specific configuration for results.

Returns

If successful, a List<> of SalienceTheme objects 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.PrepareText("Lexalytics is headquartered in Amherst, MA");
    if (nRet==0)
    {
        List<SalienceTheme> myThemes = Engine.GetDocumentThemes(String.Empty);
        foreach (SalienceTheme aTheme in myThemes)
        {
            ....
        }
    }

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