mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-21 09:14:34 +00:00
forgot to do dynamic updates of the predictor
that'll be handy once we have a real IME
This commit is contained in:
parent
ab277a6cdd
commit
9a455051bf
1 changed files with 7 additions and 0 deletions
|
|
@ -400,6 +400,7 @@ impl InputTracker {
|
||||||
if !(trigger.punctuation && k.is_ascii_punctuation() ||
|
if !(trigger.punctuation && k.is_ascii_punctuation() ||
|
||||||
trigger.whitespace && k.is_ascii_whitespace() ) {
|
trigger.whitespace && k.is_ascii_whitespace() ) {
|
||||||
self.pred_phrase.push(k).expect("IMEF: ran out of space pushing character into prediction phrase");
|
self.pred_phrase.push(k).expect("IMEF: ran out of space pushing character into prediction phrase");
|
||||||
|
update_predictor = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.characters += 1;
|
self.characters += 1;
|
||||||
|
|
@ -498,6 +499,12 @@ impl InputTracker {
|
||||||
if debug1{info!("IMEF: got pc_bound {:?}", pc_bounds);}
|
if debug1{info!("IMEF: got pc_bound {:?}", pc_bounds);}
|
||||||
|
|
||||||
if update_predictor {
|
if update_predictor {
|
||||||
|
if self.pred_phrase.len() > 0 {
|
||||||
|
if let Some(pred) = self.predictor {
|
||||||
|
pred.set_input(self.pred_phrase).expect("IMEF: couldn't update predictor with current input");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Query the prediction engine for the latest predictions
|
// Query the prediction engine for the latest predictions
|
||||||
if let Some(pred) = self.predictor {
|
if let Some(pred) = self.predictor {
|
||||||
for i in 0..self.pred_options.len() {
|
for i in 0..self.pred_options.len() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue