private void indexFragments(String word) { wordlist.add(word); int wordNr = wordlist.size() - 1; // create deletes aka fragements for (String fragment : getEdits(word, 0, new HashSet<String>())) { Object dictionaryEntry; dictionaryEntry = dictionary.get(fragment); if (dictionaryEntry != null) { // scenario where this entry already exists: // 1. word == deletes(anotherWord) // 2. deletes(word) == deletes(anotherWord) if (dictionaryEntry instanceof Integer) { DictionaryItem dictItem = asDictionaryItem(dictionaryEntry); dictionary.put(fragment, dictItem); if (wordNr != (int) dictionaryEntry) addLowestDistance(dictItem, word, wordNr, fragment); } else if (!((DictionaryItem) dictionaryEntry).suggestions.contains(wordNr)) addLowestDistance((DictionaryItem) dictionaryEntry, word, wordNr, fragment); } else { dictionary.put(fragment, wordNr); } } }
nSteps = learnIteration - iteration; if(steps.contains(nSteps)) { double[] predictDist = inferSingleStep(learnPatternNZ, weightMatrix.get(nSteps)); double[] targetDistMinusPredictDist = new double[maxBucketIdx + 1];
for (TripPattern pattern : tripPatterns) { for (int stopIndex : pattern.stops) { if (!patternsForStop.get(stopIndex).contains(p)) { patternsForStop.get(stopIndex).add(p);
for (TripPattern pattern : tripPatterns) { for (int stopIndex : pattern.stops) { if (!patternsForStop.get(stopIndex).contains(p)) { patternsForStop.get(stopIndex).add(p);
if(steps.contains(nSteps)) { for(int row = 0; row <= maxBucketIdx; row++) { for (int bit : learnPatternNZ) {
if(entityDragon.healingEnderCrystal != null && connectedCrystalsIds.contains(entityDragon.healingEnderCrystal.getEntityId())) {