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

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: 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
« no previous file with comments | « services/prediction/BUILD.gn ('k') | services/prediction/dictionary_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ba174db1ab06b6b4c744185e9951a8289db97161
--- /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 "base/memory/scoped_ptr.h"
+#include "mojo/services/prediction/public/interfaces/prediction.mojom.h"
+#include "services/prediction/proximity_info_factory.h"
+
+namespace latinime {
+
+class Dictionary;
+class DicTraverseSession;
+class PrevWordsInfo;
+} // namespace latinime
+
+namespace prediction {
+
+class DictionaryService {
+ public:
+ DictionaryService();
+ ~DictionaryService();
+
+ mojo::Array<mojo::String> GetDictionarySuggestion(
+ PredictionInfoPtr prediction_info,
+ latinime::ProximityInfo* proximity_info);
+
+ private:
+ void CreatDictFromEmbeddedDataIfNotExist(const std::string path);
+
+ latinime::Dictionary* const OpenDictionary(const std::string path,
+ const int start_offset,
+ const int size,
+ const bool is_updatable);
+
+ latinime::PrevWordsInfo ProcessPrevWord(
+ mojo::Array<PrevWordInfoPtr>& prev_words);
+
+ int max_suggestion_size_;
+ scoped_ptr<latinime::Dictionary> default_dictionary_;
+ scoped_ptr<latinime::DicTraverseSession> default_session_;
+
+ DISALLOW_COPY_AND_ASSIGN(DictionaryService);
+};
+
+} // namespace prediction
+
+#endif // SERVICES_PREDICTION_DICTIONARY_SERVICE_H_
« no previous file with comments | « services/prediction/BUILD.gn ('k') | services/prediction/dictionary_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698