aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/makedict/ProbabilityInfo.java
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-02-05 04:40:11 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2014-02-05 04:40:11 -0800
commitf79fc391f4a14a0fbf85520d43f93cbaa1aa9b75 (patch)
treed187ada0d2b5db3e23c57345f2e598350f9139a0 /java/src/com/android/inputmethod/latin/makedict/ProbabilityInfo.java
parent7f2655eafd5941407f63c82445d7cab509a9b920 (diff)
parente42380a471c0765ccd71ae34d6bc99a272deec52 (diff)
downloadlatinime-f79fc391f4a14a0fbf85520d43f93cbaa1aa9b75.tar.gz
latinime-f79fc391f4a14a0fbf85520d43f93cbaa1aa9b75.tar.xz
latinime-f79fc391f4a14a0fbf85520d43f93cbaa1aa9b75.zip
am e42380a4: Merge "Separate ProbabilityInfo form WordProperty."
* commit 'e42380a471c0765ccd71ae34d6bc99a272deec52': Separate ProbabilityInfo form WordProperty.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/ProbabilityInfo.java')
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/ProbabilityInfo.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/ProbabilityInfo.java b/java/src/com/android/inputmethod/latin/makedict/ProbabilityInfo.java
new file mode 100644
index 000000000..c1a43cedf
--- /dev/null
+++ b/java/src/com/android/inputmethod/latin/makedict/ProbabilityInfo.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.inputmethod.latin.makedict;
+
+import com.android.inputmethod.latin.BinaryDictionary;
+
+public final class ProbabilityInfo {
+ public final int mProbability;
+ // mTimestamp, mLevel and mCount are historical info. These values are depend on the
+ // implementation in native code; thus, we must not use them and have any assumptions about
+ // them except for tests.
+ public final int mTimestamp;
+ public final int mLevel;
+ public final int mCount;
+
+ public ProbabilityInfo(final int probability) {
+ this(probability, BinaryDictionary.NOT_A_VALID_TIMESTAMP, 0, 0);
+ }
+
+ public ProbabilityInfo(final int probability, final int timestamp, final int level,
+ final int count) {
+ mProbability = probability;
+ mTimestamp = timestamp;
+ mLevel = level;
+ mCount = count;
+ }
+
+ @Override
+ public String toString() {
+ return mTimestamp + ":" + mLevel + ":" + mCount;
+ }
+} \ No newline at end of file