Salience.GetSalienceVersion

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

Summary

Gets the version of the library. You can use this to display a version of the underlying Salience Engine in use. This is a wrapper around the underlying C API method lxaGetSalienceVersion.

Syntax

public string GetSalienceVersion()

Parameters

None

Returns

A string containing the version of the underlying Salience Engine library.

Example

    //The SalienceEngine object wraps all of the Salience functionality 
    //and must be initialized to use the library.
    Salience 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 Salience(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("SalienceEngine version: " + Engine.GetSalienceVersion());

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