Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(738)

Unified Diff: third_party/android_prediction/suggest/core/dicnode/dic_node_utils.h

Issue 1247903003: Add spellcheck and word suggestion to the prediction service (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: format README and CHROMIUM.diff Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/android_prediction/suggest/core/dicnode/dic_node_utils.h
diff --git a/third_party/android_prediction/suggest/core/dicnode/dic_node_utils.h b/third_party/android_prediction/suggest/core/dicnode/dic_node_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..fadad5f05d5330495fe8536bcc6ba32b5752cb09
--- /dev/null
+++ b/third_party/android_prediction/suggest/core/dicnode/dic_node_utils.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+#ifndef LATINIME_DIC_NODE_UTILS_H
+#define LATINIME_DIC_NODE_UTILS_H
+
+#include "third_party/android_prediction/defines.h"
+
+namespace latinime {
+
+class DicNode;
+class DicNodeVector;
+class DictionaryStructureWithBufferPolicy;
+class MultiBigramMap;
+
+class DicNodeUtils {
+ public:
+ static void initAsRoot(
+ const DictionaryStructureWithBufferPolicy *const dictionaryStructurePolicy,
+ const int *const prevWordPtNodePos, DicNode *const newRootDicNode);
+ static void initAsRootWithPreviousWord(
+ const DictionaryStructureWithBufferPolicy *const dictionaryStructurePolicy,
+ const DicNode *const prevWordLastDicNode, DicNode *const newRootDicNode);
+ static void initByCopy(const DicNode *const srcDicNode, DicNode *const destDicNode);
+ static void getAllChildDicNodes(const DicNode *dicNode,
+ const DictionaryStructureWithBufferPolicy *const dictionaryStructurePolicy,
+ DicNodeVector *childDicNodes);
+ static float getBigramNodeImprobability(
+ const DictionaryStructureWithBufferPolicy *const dictionaryStructurePolicy,
+ const DicNode *const dicNode, MultiBigramMap *const multiBigramMap);
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(DicNodeUtils);
+ // Max number of bigrams to look up
+ static const int MAX_BIGRAMS_CONSIDERED_PER_CONTEXT = 500;
+
+ static int getBigramNodeProbability(
+ const DictionaryStructureWithBufferPolicy *const dictionaryStructurePolicy,
+ const DicNode *const dicNode, MultiBigramMap *const multiBigramMap);
+};
+} // namespace latinime
+#endif // LATINIME_DIC_NODE_UTILS_H

Powered by Google App Engine
This is Rietveld 408576698