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

Unified Diff: services/prediction/dictionary_service.h

Issue 1247903003: Add spellcheck and word suggestion to the prediction service (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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: services/prediction/dictionary_service.h
diff --git a/services/prediction/dictionary_service.h b/services/prediction/dictionary_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..dc0c97976e98367099d74f74e847aa49d46edb9c
--- /dev/null
+++ b/services/prediction/dictionary_service.h
@@ -0,0 +1,51 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SERVICES_PREDICTION_DICTIONARY_SERVICE_H_
+#define SERVICES_PREDICTION_DICTIONARY_SERVICE_H_
+
+#include "base/macros.h"
+#include "mojo/services/prediction/public/interfaces/prediction.mojom.h"
+#include "services/prediction/proximity_info_service.h"
+
+namespace latinime {
+
+class Dictionary;
+class DicTraverseSession;
+class PrevWordsInfo;
+}
APW 2015/07/23 18:02:15 // namespace latinime
riajiang 2015/07/31 02:13:04 Done.
+
+namespace prediction {
+
+class DictionaryService {
+ public:
+ DictionaryService();
+ ~DictionaryService();
+
+ mojo::Array<mojo::String> GetDictionarySuggestion(
+ PredictionInfoPtr prediction_info,
+ ProximityInfoService* proximity_info);
+
+ private:
+ int max_suggestion_size;
APW 2015/07/23 18:02:15 private member variables must end in underscore.
riajiang 2015/07/31 02:13:04 Done. How about the sequence between static membe
+ latinime::Dictionary* default_dictionary;
+ latinime::DicTraverseSession* default_session;
+
+ void LoadDictionary();
+
+ latinime::Dictionary* const OpenDictionary(const std::string path,
+ const int start_offset,
+ const int size,
+ const bool is_updatable);
+
+ latinime::PrevWordsInfo* ProcessPrevWord(
+ mojo::Array<mojo::String>& prev_words,
+ mojo::Array<bool>& beginnings);
+
+ DISALLOW_COPY_AND_ASSIGN(DictionaryService);
+};
+
+} // namespace prediction
+
+#endif // SERVICES_PREDICTION_DICTIONARY_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698