C# Class ACAT.Extensions.Default.WordPredictors.PresageWCF.PresageWordPredictor

Inheritance: IWordPredictor
显示文件 Open project: brlima94/acat-localization

Public Methods

Method Description
Dispose ( ) : void

Disposer for this class

Init ( ) : bool

Performs initialization. Must be called first. Sets word prediction parameters and initializes Presage

Learn ( String text ) : bool

Adds the specified text to the user's personal word prediction model to learn the user's writing style. This makes word prediciton more relevant.

LoadContext ( String text ) : int

Loads the text into a temporary context. This could for instance be the text from a notepad or word document. This makes word prediction more contextual to the document being edited. Call UnloadContext to unload it. This function is not currently supported.

LoadDefaultSettings ( ) : bool

Returns factory default settings.

LoadSettings ( String settingsFilePath ) : bool

Loads settings from the specified file and sets properties from the settings file.

Predict ( String prevWords, String currentWord ) : IEnumerable

Returns a list of next word predictions based on the context from the previous words in the sentence. The number of words returned is set by the PredictionWordCount property

SaveSettings ( String settingsFilePath ) : bool

Saves the word predictor settings to a file that is maintained by the word predictor.

UnloadContext ( int contextHandle ) : void

Unloads previously loaded context (see LoadContext). Not used.

Private Methods

Method Description
checkAndRunPresage ( ) : void

Checks if Presage is already running, if not launches it.

deletePresageConfigFile ( ) : void

Deletes the presage.xml file that is in the users folder.

getPresageInstallDir ( ) : string

Returns the install dir of the Presage word predictor

initPresage ( ) : bool

Initializes the Presage word prediction engine.

isPresageRunning ( ) : bool

Checks if Presage wcf tray app is running

matchPrefix ( String prefix, String word ) : bool

Checks to see how much of the prefix matches with the specified word. The preference setting WordPredictionFilterMatchPrefixLengthAdjust controls how many chars to match. If a match if found, returns true

predict ( String prevWords, String currentWord, bool &success ) : IEnumerable

Returns a list of next word predictions based on the context from the previous words in the sentence. The number of words returned is set by the PredictionWordCount property

runPresage ( ) : void

Runs the Presage WCF tray app

updateSettings ( ACAT.Lib.Extension.ACATPreferences prefs ) : void

Updates class variables with ACAT settings stored in prefs

Method Details

Dispose() public method

Disposer for this class
public Dispose ( ) : void
return void

Init() public method

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

Learn() public method

Adds the specified text to the user's personal word prediction model to learn the user's writing style. This makes word prediciton more relevant.
public Learn ( String text ) : bool
text String Text to add
return bool

LoadContext() public method

Loads the text into a temporary context. This could for instance be the text from a notepad or word document. This makes word prediction more contextual to the document being edited. Call UnloadContext to unload it. This function is not currently supported.
public LoadContext ( String text ) : int
text String Text to add to the context
return int

LoadDefaultSettings() public method

Returns factory default settings.
public LoadDefaultSettings ( ) : bool
return bool

LoadSettings() public method

Loads settings from the specified file and sets properties from the settings file.
public LoadSettings ( String settingsFilePath ) : bool
settingsFilePath String path to the settings file
return bool

Predict() public method

Returns a list of next word predictions based on the context from the previous words in the sentence. The number of words returned is set by the PredictionWordCount property
public Predict ( String prevWords, String currentWord ) : IEnumerable
prevWords String Previous words in the sentence
currentWord String current word (may be partially spelt out
return IEnumerable

SaveSettings() public method

Saves the word predictor settings to a file that is maintained by the word predictor.
public SaveSettings ( String settingsFilePath ) : bool
settingsFilePath String Directory where the settings are stored
return bool

UnloadContext() public method

Unloads previously loaded context (see LoadContext). Not used.
public UnloadContext ( int contextHandle ) : void
contextHandle int the handle
return void