HomeSort by relevance Sort by last modified time
    Searched refs:bigrams (Results 1 - 22 of 22) sorted by null

  /packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/makedict/
PtNodeInfo.java 41 final ArrayList<PendingAttribute> bigrams) {
50 mBigrams = bigrams;
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.");
Word.java 41 final ArrayList<WeightedString> bigrams,
46 mBigrams = bigrams;
DynamicBinaryDictIOUtils.java 189 * @param bigrams the bigrams for this PtNode.
201 final ArrayList<PendingAttribute> bigrams, final OutputStream destination,
209 shortcutTargets, bigrams);
214 bigrams);
227 final ArrayList<PendingAttribute> bigrams = CollectionUtils.newArrayList();
233 bigrams.add(new PendingAttribute(bigram.mFrequency, pos));
236 return bigrams;
261 final ArrayList<PendingAttribute> bigrams = resolveBigramPositions(dictUpdater, local
266 final boolean hasBigrams = !bigrams.isEmpty()
    [all...]
Ver4DictDecoder.java 244 final ArrayList<PendingAttribute> bigrams; local
246 bigrams = new ArrayList<PendingAttribute>();
249 while (bigrams.size() < FormatSpec.MAX_BIGRAMS_IN_A_PTNODE) {
250 // If bigrams.size() reaches FormatSpec.MAX_BIGRAMS_IN_A_PTNODE,
257 bigrams.add(new PendingAttribute(
262 if (bigrams.size() >= FormatSpec.MAX_BIGRAMS_IN_A_PTNODE) {
263 throw new RuntimeException("Too many bigrams in a PtNode (" + bigrams.size()
267 bigrams = null;
270 parentAddress, childrenAddress, shortcutTargets, bigrams);
    [all...]
AbstractDictDecoder.java 80 final TreeMap<Integer, ArrayList<PendingAttribute>> bigrams)
85 BinaryDictIOUtils.readUnigramsAndBigramsBinary(this, words, frequencies, bigrams);
174 final ArrayList<PendingAttribute> bigrams, final int baseAddress) {
197 throw new RuntimeException("Has bigrams with no address");
199 bigrams.add(new PendingAttribute(
FusionDictionary.java 96 * PtNode is a group of characters, with a frequency, shortcut targets, bigrams, and children
106 * bigrams, but a non-terminal may not. Moreover, children, if present, are null.
129 final ArrayList<WeightedString> bigrams, final int frequency,
135 mBigrams = bigrams;
142 final ArrayList<WeightedString> bigrams, final int frequency,
148 mBigrams = bigrams;
238 * Returns null if the word is not in the bigrams list.
260 final ArrayList<WeightedString> bigrams,
281 if (bigrams != null) {
283 mBigrams = bigrams;
    [all...]
Ver3DictEncoder.java 213 * @param bigrams the bigram attributes list.
216 private void writeBigrams(final ArrayList<WeightedString> bigrams,
218 if (bigrams == null) return;
220 final Iterator<WeightedString> bigramIterator = bigrams.iterator();
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
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);
DictDecoder.java 84 * Reads unigrams and bigrams from the binary file.
89 * @param bigrams the map to store the address as a key and the list of address as a value.
96 final TreeMap<Integer, ArrayList<PendingAttribute>> 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/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) {
XmlDictInputOutput.java 302 * @param bigrams the file to read the bigrams from, or null.
306 final InputStream shortcuts, final InputStream bigrams)
312 if (null != bigrams) parser.parse(bigrams, bigramHandler);
339 * which has no support for bigrams or shortcuts/whitelist.
350 * The output format is the "second" format, which supports bigrams and shortcuts/whitelist.
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/tests/src/com/android/inputmethod/latin/makedict/
BinaryDictDecoderEncoderTests.java 166 final SparseArray<List<Integer>> bigrams) {
167 for (int i = 0; i < bigrams.size(); ++i) {
168 final int w1 = bigrams.keyAt(i);
169 for (int w2 : bigrams.valueAt(i)) {
207 final SparseArray<List<Integer>> bigrams,
218 for (int i = 0; i < bigrams.size(); ++i) {
219 final int w1 = bigrams.keyAt(i);
220 for (final int w2 : bigrams.valueAt(i)) {
283 final SparseArray<List<Integer>> bigrams,
301 checkDictionary(dict, words, bigrams, shortcutMap)
    [all...]
BinaryDictIOUtilsTests.java 188 final boolean exist, final ArrayList<WeightedString> bigrams,
204 dictUpdater.insertWord(word, frequency, bigrams, shortcuts, false, false);
  /packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/
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()));
BinaryDictionaryTests.java 650 final HashSet<Pair<String, String>> bigrams = new HashSet<Pair<String, String>>(); local
    [all...]
  /packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/utils/
UserHistoryDictIOUtilsTests.java 57 * Return same frequency for all words and bigrams
102 final HashMap<String, ArrayList<String> > bigrams) {
103 for (final String word : bigrams.keySet()) {
104 if (bigrams.containsKey(word)) {
105 checkWordInFusionDict(dict, word, bigrams.get(word));
119 // check bigrams
  /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...]

Completed in 490 milliseconds