/packages/inputmethods/LatinIME/tools/dicttool/src/com/android/inputmethod/latin/dicttool/ |
Info.java | 91 final ArrayList<WeightedString> bigrams = ptNode.getBigrams(); local 92 if (null == bigrams || bigrams.isEmpty()) { 93 System.out.println(" No bigrams"); 95 for (final WeightedString bigram : bigrams) {
|
CombinedInputOutput.java | 127 ArrayList<WeightedString> bigrams = new ArrayList<WeightedString>(); local 135 for (WeightedString s : bigrams) { 140 if (!bigrams.isEmpty()) bigrams = new ArrayList<WeightedString>(); 185 bigrams.add(new WeightedString(secondWordOfBigram, bigramFreq)); 193 for (WeightedString s : bigrams) {
|
DictionaryMaker.java | 98 throw new RuntimeException("Separate bigrams/shortcut files are only supported" 99 + " with XML input (other formats include bigrams and shortcuts already)"); 127 + "[-s <unigrams.xml> [-b <bigrams.xml>] [-c <shortcuts_and_whitelist.xml>] " 134 + " Source can be an XML file, with an optional XML bigrams file, or a\n" 305 * @param bigramXmlFilename the name of the bigram XML file. Pass null if there are no bigrams. 318 final FileInputStream bigrams = null == bigramXmlFilename ? null : local 320 return XmlDictInputOutput.readDictionaryXml(unigrams, shortcuts, bigrams);
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/utils/ |
UserHistoryDictIOUtils.java | 74 final BigramDictionaryInterface dict, final UserHistoryDictionaryBigramList bigrams, 76 final FusionDictionary fusionDict = constructFusionDictionary(dict, bigrams); 95 final BigramDictionaryInterface dict, final UserHistoryDictionaryBigramList bigrams) { 100 for (final String word1 : bigrams.keySet()) { 101 final HashMap<String, Byte> word1Bigrams = bigrams.getBigrams(word1); 125 bigrams.updateBigram(word1, word2, (byte)freq); 141 final TreeMap<Integer, ArrayList<PendingAttribute>> bigrams = CollectionUtils.newTreeMap(); local 143 dictDecoder.readUnigramsAndBigramsBinary(unigrams, frequencies, bigrams); 151 addWordsFromWordMap(unigrams, frequencies, bigrams, dict); 155 * Adds all unigrams and bigrams in maps to OnAddWordListener [all...] |
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/makedict/ |
DynamicBinaryDictIOUtils.java | 188 * @param bigrams the bigrams for this PtNode. 200 final ArrayList<PendingAttribute> bigrams, final OutputStream destination, 208 shortcutTargets, bigrams); 213 bigrams); 241 final ArrayList<PendingAttribute> bigrams = new ArrayList<PendingAttribute>(); local 249 bigrams.add(new PendingAttribute(bigram.mFrequency, position)); 255 final boolean hasBigrams = !bigrams.isEmpty(); 300 frequency, nodeParentAddress, shortcuts, bigrams, destination, 376 FormatSpec.NO_CHILDREN_ADDRESS, shortcuts, bigrams); [all...] |
Ver4DictDecoder.java | 240 final ArrayList<PendingAttribute> bigrams; local 242 bigrams = new ArrayList<PendingAttribute>(); 245 while (bigrams.size() < FormatSpec.MAX_BIGRAMS_IN_A_PTNODE) { 246 // If bigrams.size() reaches FormatSpec.MAX_BIGRAMS_IN_A_PTNODE, 253 bigrams.add(new PendingAttribute( 258 if (bigrams.size() >= FormatSpec.MAX_BIGRAMS_IN_A_PTNODE) { 259 throw new RuntimeException("Too many bigrams in a PtNode (" + bigrams.size() 263 bigrams = null; 266 parentAddress, childrenAddress, shortcutTargets, bigrams); [all...] |
BinaryDictDecoderUtils.java | 462 ArrayList<WeightedString> bigrams = null; local 464 bigrams = new ArrayList<WeightedString>(); 471 bigrams.add(new WeightedString(word.mWord, reconstructedFrequency)); 484 new PtNode(info.mCharacters, shortcutTargets, bigrams, 490 new PtNode(info.mCharacters, shortcutTargets, bigrams, 572 // By construction a binary dictionary may not have bigrams pointing to
|
AbstractDictDecoder.java | 79 final TreeMap<Integer, ArrayList<PendingAttribute>> bigrams) 84 BinaryDictIOUtils.readUnigramsAndBigramsBinary(this, words, frequencies, bigrams); 173 final ArrayList<PendingAttribute> bigrams, final int baseAddress) { 196 throw new RuntimeException("Has bigrams with no address"); 198 bigrams.add(new PendingAttribute(
|
Ver3DictDecoder.java | 166 final ArrayList<PendingAttribute> bigrams; local 168 bigrams = new ArrayList<PendingAttribute>(); 169 addressPointer += PtNodeReader.readBigramAddresses(mDictBuffer, bigrams, 171 if (bigrams.size() >= FormatSpec.MAX_BIGRAMS_IN_A_PTNODE) { 172 throw new RuntimeException("Too many bigrams in a PtNode (" + bigrams.size() 176 bigrams = null; 179 parentAddress, childrenAddress, shortcutTargets, bigrams); 267 throw new RuntimeException("Too many bigrams in a PtNode.");
|
BinaryDictIOUtils.java | 67 final Map<Integer, ArrayList<PendingAttribute>> bigrams, 111 if (info.mBigrams != null) bigrams.put(info.mOriginalAddress, info.mBigrams); 141 * Reads unigrams and bigrams from the binary file. 147 * @param bigrams the map to store the address as a key and the list of address as a value. 153 final Map<Integer, ArrayList<PendingAttribute>> bigrams) throws IOException, 158 frequencies, bigrams, header.mFormatOptions);
|
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/ |
BinaryDictionaryTests.java | 650 final HashSet<Pair<String, String>> bigrams = new HashSet<Pair<String, String>>(); local [all...] |
BinaryDictionaryDecayingTests.java | 128 // Add bigrams of not valid unigrams. 263 final ArrayList<Pair<String, String>> bigrams = new ArrayList<Pair<String, String>>(); local 278 bigrams.add(bigram); 284 final Pair<String, String> bigram = bigrams.get(random.nextInt(bigrams.size()));
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/ |
ExpandableDictionary.java | 294 LinkedList<NextWord> bigrams = firstWord.mNGrams; 296 if (bigrams == null || bigrams.size() == 0) { 299 for (NextWord nw : bigrams) { 309 return bigrams.remove(bigramNode); 326 LinkedList<NextWord> bigrams = firstWord.mNGrams; 327 if (bigrams == null || bigrams.size() == 0) { 330 for (NextWord nw : bigrams) { 511 * Adds bigrams to the in-memory trie structure that is being used to retrieve any wor 535 LinkedList<NextWord> bigrams = firstWord.mNGrams; local [all...] |