aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorKurt Partridge <kep@google.com>2013-05-15 23:31:31 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-05-15 23:31:31 +0000
commit7af5300c7dc8d3816b0f02fa9dae112d3d22a71a (patch)
tree3e8ce2da2abb56957ba709e85e47afa8f9e7deb9 /java/src
parenta404e36520c975660f9fbc0c7ae65353407140d4 (diff)
parent3e8df13cd761e376a9a8cb324f6ea9e5db0af9fc (diff)
downloadlatinime-7af5300c7dc8d3816b0f02fa9dae112d3d22a71a.tar.gz
latinime-7af5300c7dc8d3816b0f02fa9dae112d3d22a71a.tar.xz
latinime-7af5300c7dc8d3816b0f02fa9dae112d3d22a71a.zip
Merge "Add claifying comment"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/research/MainLogBuffer.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/research/MainLogBuffer.java b/java/src/com/android/inputmethod/research/MainLogBuffer.java
index 9aa349906..7e8f16697 100644
--- a/java/src/com/android/inputmethod/research/MainLogBuffer.java
+++ b/java/src/com/android/inputmethod/research/MainLogBuffer.java
@@ -196,6 +196,22 @@ public abstract class MainLogBuffer extends FixedLogBuffer {
}
}
+ /**
+ * If there is a safe n-gram at the front of this log buffer, publish it with all details, and
+ * remove the LogUnits that constitute it.
+ *
+ * An n-gram might not be "safe" if it violates privacy controls. E.g., it might contain
+ * numbers, an out-of-vocabulary word, or another n-gram may have been published recently. If
+ * there is no safe n-gram, then the LogUnits up through the first word-containing LogUnit are
+ * published, but without disclosing any privacy-related details, such as the word the LogUnit
+ * generated, motion data, etc.
+ *
+ * Note that a LogUnit can hold more than one word if the user types without explicit spaces.
+ * In this case, the words may be grouped together in such a way that pulling an n-gram off the
+ * front would require splitting a LogUnit. Splitting a LogUnit is not possible, so this case
+ * is treated just as the unsafe n-gram case. This may cause n-grams to be sampled at slightly
+ * less than the target frequency.
+ */
protected final void publishLogUnitsAtFrontOfBuffer() throws IOException {
// TODO: Refactor this method to require fewer passes through the LogUnits. Should really
// require only one pass.