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 package com.android.inputmethod.latin.makedict; 18 19 import com.android.inputmethod.annotations.UsedForTesting; 20 import com.android.inputmethod.latin.makedict.FusionDictionary.WeightedString; 21 22 import java.io.IOException; 23 import java.util.ArrayList; 24 25 /** 26 * An interface of a binary dictionary updater. 27 */ 28 @UsedForTesting 29 public interface DictUpdater extends DictDecoder { 30 31 /** 32 * Deletes the word from the binary dictionary. 33 * 34 * @param word the word to be deleted. 35 */ 36 @UsedForTesting 37 public void deleteWord(final String word) throws IOException, UnsupportedFormatException; 38 39 /** 40 * Inserts a word into a binary dictionary. 41 * 42 * @param word the word to be inserted. 43 * @param frequency the frequency of the new word. 44 * @param bigramStrings bigram list, or null if none. 45 * @param shortcuts shortcut list, or null if none. 46 * @param isBlackListEntry whether this should be a blacklist entry. 47 */ 48 // TODO: Support batch insertion. 49 @UsedForTesting 50 public void insertWord(final String word, final int frequency, 51 final ArrayList<WeightedString> bigramStrings, 52 final ArrayList<WeightedString> shortcuts, final boolean isNotAWord, 53 final boolean isBlackListEntry) throws IOException, UnsupportedFormatException; 54 } 55