ACAT.Extensions.Default.WordPredictors.PresageWCF.PresageWordPredictor.Init C# (CSharp) Method

Init() public method

Performs initialization. Must be called first. Sets word prediction parameters and initializes Presage
public Init ( ) : bool
return bool
        public bool Init()
        {
            bool retVal = false;

            try
            {
                Attributions.Add("PRESAGE",
                                Resources.PresageAttribution);

                Settings.PreferencesFilePath = UserManager.GetFullPath(SettingsFileName);

                _presageSettings = Settings.Load();

                if (_presageSettings.StartPresageIfNotRunning)
                {
                    checkAndRunPresage();
                }

                retVal = initPresage();
                if (!retVal)
                {
                    // failure mostly means the presage config file has an
                    // incorrect database path.  Delete the config file so
                    // it will regenerate and then we can insert the correct
                    // database path when we init again
                    deletePresageConfigFile();
                    retVal = initPresage();
                }
            }
            catch (Exception ex)
            {
                Log.Debug("Error initializing Presage. " + ex);
            }

            return retVal;
        }