Home | History | Annotate | Download | only in interface
      1 /*
      2  * Copyright (C) 2013, 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_DICTIONARY_HEADER_STRUCTURE_POLICY_H
     18 #define LATINIME_DICTIONARY_HEADER_STRUCTURE_POLICY_H
     19 
     20 #include <map>
     21 #include <vector>
     22 
     23 #include "defines.h"
     24 
     25 namespace latinime {
     26 
     27 /*
     28  * This class abstracts structure of dictionaries.
     29  * Implement this policy to support additional dictionaries.
     30  */
     31 class DictionaryHeaderStructurePolicy {
     32  public:
     33     typedef std::map<std::vector<int>, std::vector<int>> AttributeMap;
     34 
     35     virtual ~DictionaryHeaderStructurePolicy() {}
     36 
     37     virtual int getFormatVersionNumber() const = 0;
     38 
     39     virtual int getSize() const = 0;
     40 
     41     virtual const AttributeMap *getAttributeMap() const = 0;
     42 
     43     virtual bool requiresGermanUmlautProcessing() const = 0;
     44 
     45     virtual float getMultiWordCostMultiplier() const = 0;
     46 
     47     virtual void readHeaderValueOrQuestionMark(const char *const key, int *outValue,
     48             int outValueSize) const = 0;
     49 
     50     virtual bool shouldBoostExactMatches() const = 0;
     51 
     52     virtual const std::vector<int> *getLocale() const = 0;
     53 
     54     virtual bool supportsBeginningOfSentence() const = 0;
     55 
     56  protected:
     57     DictionaryHeaderStructurePolicy() {}
     58 
     59  private:
     60     DISALLOW_COPY_AND_ASSIGN(DictionaryHeaderStructurePolicy);
     61 };
     62 } // namespace latinime
     63 #endif /* LATINIME_DICTIONARY_HEADER_STRUCTURE_POLICY_H */
     64