language_model_dict_content.h revision c4696b2eb6b25eea4d5c869683104ab99aec0421
1/* 2 * Copyright (C) 2014, The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#ifndef LATINIME_LANGUAGE_MODEL_DICT_CONTENT_H 18#define LATINIME_LANGUAGE_MODEL_DICT_CONTENT_H 19 20#include <cstdio> 21 22#include "defines.h" 23#include "suggest/policyimpl/dictionary/utils/trie_map.h" 24#include "utils/byte_array_view.h" 25 26namespace latinime { 27 28class LanguageModelDictContent { 29 public: 30 LanguageModelDictContent(const ReadWriteByteArrayView trieMapBuffer, 31 const bool hasHistoricalInfo) 32 : mTrieMap(trieMapBuffer) {} 33 34 explicit LanguageModelDictContent(const bool hasHistoricalInfo) : mTrieMap() {} 35 36 bool save(FILE *const file) const; 37 38 private: 39 DISALLOW_COPY_AND_ASSIGN(LanguageModelDictContent); 40 41 TrieMap mTrieMap; 42}; 43} // namespace latinime 44#endif /* LATINIME_LANGUAGE_MODEL_DICT_CONTENT_H */ 45