summaryrefslogtreecommitdiffstats
path: root/core/java/android/gesture/GestureLibrary.java
diff options
context:
space:
mode:
authorYang Li <liyang@google.com>2009-05-27 18:19:04 -0700
committerYang Li <liyang@google.com>2009-05-27 18:19:04 -0700
commit58b359041a29418876f12d37a7082ece9f8a38a4 (patch)
tree1bcdc590cc499afe5328b5b96276ee8a44fa85a1 /core/java/android/gesture/GestureLibrary.java
parentb082ceefdc877bda2159a8d66d854576e0511d15 (diff)
downloadframeworks_base-58b359041a29418876f12d37a7082ece9f8a38a4.zip
frameworks_base-58b359041a29418876f12d37a7082ece9f8a38a4.tar.gz
frameworks_base-58b359041a29418876f12d37a7082ece9f8a38a4.tar.bz2
Bug fixes and performance improvements
- Added affine transform functions in GestureUtilities to remove Matrix - Fixed a bug with Instance.createInstance - Updated letter recognition file
Diffstat (limited to 'core/java/android/gesture/GestureLibrary.java')
-rw-r--r--core/java/android/gesture/GestureLibrary.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/java/android/gesture/GestureLibrary.java b/core/java/android/gesture/GestureLibrary.java
index 1cf192e..9020d2b 100644
--- a/core/java/android/gesture/GestureLibrary.java
+++ b/core/java/android/gesture/GestureLibrary.java
@@ -136,7 +136,7 @@ public class GestureLibrary {
* @return a list of predictions of possible entries for a given gesture
*/
public ArrayList<Prediction> recognize(Gesture gesture) {
- Instance instance = Instance.createInstance(mSequenceType, gesture, null);
+ Instance instance = Instance.createInstance(mSequenceType, mOrientationStyle, gesture, null);
return mClassifier.classify(mSequenceType, instance.vector);
}
@@ -156,7 +156,7 @@ public class GestureLibrary {
mNamedGestures.put(entryName, gestures);
}
gestures.add(gesture);
- mClassifier.addInstance(Instance.createInstance(mSequenceType, gesture, entryName));
+ mClassifier.addInstance(Instance.createInstance(mSequenceType, mOrientationStyle, gesture, entryName));
mChanged = true;
}
@@ -337,10 +337,14 @@ public class GestureLibrary {
for (int j = 0; j < gestureCount; j++) {
final Gesture gesture = Gesture.deserialize(in);
gestures.add(gesture);
- classifier.addInstance(Instance.createInstance(mSequenceType, gesture, name));
+ classifier.addInstance(Instance.createInstance(mSequenceType, mOrientationStyle, gesture, name));
}
namedGestures.put(name, gestures);
}
}
+
+ Learner getLearner() {
+ return mClassifier;
+ }
}