public View getRestrictedView(Predicate<Constituent> constituentPredicate, ITransformer<View, Double> scoreTransformer) { View restriction = createRestrictedView(scoreTransformer); if (restriction == null) return null; Queue<Constituent> constituentsToConsider = new LinkedList<>(); for (Constituent c : getFilteredConstituents(constituentPredicate)) { restriction.addConstituent(c); constituentsToConsider.add(c); } addRelatedConstituents(restriction, constituentsToConsider); return restriction; }
public View getViewCoveringTokens(Collection<Integer> tokens, ITransformer<View, Double> scoreTransformer) { View restriction = createRestrictedView(scoreTransformer); if (restriction == null) return null; Queue<Constituent> constituentsToConsider = new LinkedList<>(); for (Constituent c : getConstituentsCoveringTokens(tokens)) { restriction.addConstituent(c); constituentsToConsider.add(c); } addRelatedConstituents(restriction, constituentsToConsider); return restriction; }
public View getRestrictedView(Predicate<Constituent> constituentPredicate, ITransformer<View, Double> scoreTransformer) { View restriction = createRestrictedView(scoreTransformer); if (restriction == null) return null; Queue<Constituent> constituentsToConsider = new LinkedList<>(); for (Constituent c : getFilteredConstituents(constituentPredicate)) { restriction.addConstituent(c); constituentsToConsider.add(c); } addRelatedConstituents(restriction, constituentsToConsider); return restriction; }
public View getViewCoveringSpan(int start, int end, ITransformer<View, Double> scoreTransformer) { View restriction = createRestrictedView(scoreTransformer); if (restriction == null) return null; Queue<Constituent> constituentsToConsider = new LinkedList<>(); for (Constituent c : getConstituentsCoveringSpan(start, end)) { restriction.addConstituent(c); constituentsToConsider.add(c); } addRelatedConstituents(restriction, constituentsToConsider); // logger.info(restriction); return restriction; }
public View getViewCoveringSpan(int start, int end, ITransformer<View, Double> scoreTransformer) { View restriction = createRestrictedView(scoreTransformer); if (restriction == null) return null; Queue<Constituent> constituentsToConsider = new LinkedList<>(); for (Constituent c : getConstituentsCoveringSpan(start, end)) { restriction.addConstituent(c); constituentsToConsider.add(c); } addRelatedConstituents(restriction, constituentsToConsider); // logger.info(restriction); return restriction; }
public View getViewCoveringTokens(Collection<Integer> tokens, ITransformer<View, Double> scoreTransformer) { View restriction = createRestrictedView(scoreTransformer); if (restriction == null) return null; Queue<Constituent> constituentsToConsider = new LinkedList<>(); for (Constituent c : getConstituentsCoveringTokens(tokens)) { restriction.addConstituent(c); constituentsToConsider.add(c); } addRelatedConstituents(restriction, constituentsToConsider); return restriction; }