SalienceCollection.DumpEnvironment

<< SalienceCollection.GetSalienceVersion | Back to Salience 6 .Net Index | SalienceCollection.AddSalienceConfiguration >>

Summary

Outputs environment information about the SalienceCollection session. This includes the data directory and user directory in use, as well as the value of any options that have been set.
This is a wrapper around the underlying C API method lxaDumpEnvironment.

Syntax

public string DumpEnvironment()

Parameters

None

Returns

A string containing the parameters of the operating environment of the current Salience session.

Example

    //The SalienceEngine object wraps all of the Salience functionality 
    //and must be initialized to use the library.
    SalienceCollection Engine = null;

    //If this application will be run on multiple machines, it may be helpful to read these paths 
    //from a configuration file or a registry key to avoid introducing dependencies on where the 
    //license and data must be installed.
    string licensePath = "C:/Program Files/Lexalytics/License.v5";
    string dataPath = "C:/Program Files/Lexalytics/data";

    try
    {
        //We declared Engine before initializing it so we could put this in a try/catch block, and 
        //have the rest of the code outside.
        Engine = new SalienceCollection(licensePath, dataPath);
    }
    catch (SalienceException e)
    {
        /*If the SalienceEngine constructor throws an error, one of these is likely to be true:
         * 1) The license file is missing/invalid/out of date
         * 2) The data directory was missing or contained incorrect files
         * 3) Salience6.dll could not be found. */
        System.Console.WriteLine("Error Loading SalienceEngine: " + e.Message);
        return;
    }

    System.Console.WriteLine(Engine.DumpEnvironment());

<< SalienceCollection.GetSalienceVersion | Back to Salience 6 .Net Index | SalienceCollection.AddSalienceConfiguration >>