/** * Updates the counts in {@link #parents} for the children of <code>f</code>. * * @param f The feature to look up. * @param label The label of the example containing this feature, or -1 if we aren't doing per * class feature counting. * @return The index of <code>f</code> in this lexicon. **/ public int childLexiconLookup(RealConjunctiveFeature f, int label) { int oldSize = lexiconInv.size(); int result = lookup(f, true, label); if (oldSize < lexiconInv.size()) { incrementParentCounts(f.getLeft(), label); incrementParentCounts(f.getRight(), label); } return result; }
/** * Updates the counts in {@link #parents} for the children of <code>f</code>. * * @param f The feature to look up. * @param label The label of the example containing this feature, or -1 if we aren't doing per * class feature counting. * @return The index of <code>f</code> in this lexicon. **/ public int childLexiconLookup(DiscreteConjunctiveFeature f, int label) { int oldSize = lexiconInv.size(); int result = lookup(f, true, label); if (oldSize < lexiconInv.size()) { incrementParentCounts(f.getLeft(), label); incrementParentCounts(f.getRight(), label); } return result; }
/** * Updates the counts in {@link #parents} for the children of <code>f</code>. * * @param f The feature to look up. * @param label The label of the example containing this feature, or -1 if we aren't doing per * class feature counting. * @return The index of <code>f</code> in this lexicon. **/ public int childLexiconLookup(RealReferrer f, int label) { int oldSize = lexiconInv.size(); int result = lookup(f, true, label); if (oldSize < lexiconInv.size()) incrementParentCounts(f.getReferent(), label); return result; }
/** * Updates the counts in {@link #parents} for the children of <code>f</code>. * * @param f The feature to look up. * @param label The label of the example containing this feature, or -1 if we aren't doing per * class feature counting. * @return The index of <code>f</code> in this lexicon. **/ public int childLexiconLookup(DiscreteReferrer f, int label) { int oldSize = lexiconInv.size(); int result = lookup(f, true, label); if (oldSize < lexiconInv.size()) incrementParentCounts(f.getReferent(), label); return result; }