Home | Trees | Indices | Help |
|
---|
|
object --+ | ContextMonitor
Monitire user current context.
This class monitore the input buffers in order to:
![]() |
Class Hierarchy for ContextMonitor |
|
|||
|
|||
bool |
|
||
|
|||
|
|||
str |
|
||
str |
|
||
str |
|
||
str |
|
||
str |
|
||
str |
|
||
str |
|
||
|
|||
Inherited from |
|
|||
Inherited from |
|
ContextMonitor creator.
|
Check if a context change occure.
|
Check if context changes occure and learn what need to be learnt. This method is called by Driver.predict() after the predictions have been computed. It check if a context change occure in the input buffers and if so, it learn the words that need to be learnt if the predictor's learning mode is ON. Finaly, it update the monitored scope. |
Learn n-grams from the input buffers. Trigger the learn() method of each predictor of the registry. This method use the input buffers to create n-grams and add them to the predictors's databases or memory so that the program learn from the user input.
|
Return the token just before the cursor.
|
Return the token just after the cursor.
|
Return the token at a given index in the left input buffer.
|
Return the token at a given index in the right input buffer.
|
Return the token just before the change token (if any). This method is called in some predictors's learn() method. It retrieve the token that appear just before the change token and has already been learnt before (or should have). The previous token is used to fill the n-grams.
|
Use the callback to get the value of the left buffer.
|
Use the callback to get the value of the right buffer.
|
Compute the completion string given a suggested word. This method compute and return the completion string using the token just before the cursor (prefix) and the suggested word (suggestion). The suggestion should be the word that the user choose from the suggested words list. For instance, if the prefix is: "wor" And the suggestion is: "world" Then this method will compute the completion: "ld" If the character before the cursor is a blankspace or a separator then the prefix should be empty: "" Then if the suggestion is: "guilty" This method will compute the completion: "guilty" If the suggestion and the prefix don't match then False is returned. This should never happen as suggestions completing an input word should always match it. Still, I prefer to check it at the cost of some lower() and startswith() calls.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Jul 14 21:07:50 2015 | http://epydoc.sourceforge.net |