streampipes-extensions/streampipes-pipeline-elements-experimental-flink/src/main/java/com/kohlschutter/boilerpipe/filters/english/DensityRulesClassifier.java [41:78]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    return INSTANCE;
  }

  public boolean process(TextDocument doc) throws BoilerpipeProcessingException {
    List<TextBlock> textBlocks = doc.getTextBlocks();
    boolean hasChanges = false;

    ListIterator<TextBlock> it = textBlocks.listIterator();
    if (!it.hasNext()) {
      return false;
    }
    TextBlock prevBlock = TextBlock.EMPTY_START;
    TextBlock currentBlock = it.next();
    TextBlock nextBlock = it.hasNext() ? it.next() : TextBlock.EMPTY_START;

    hasChanges = classify(prevBlock, currentBlock, nextBlock) | hasChanges;

    if (nextBlock != TextBlock.EMPTY_START) {
      while (it.hasNext()) {
        prevBlock = currentBlock;
        currentBlock = nextBlock;
        nextBlock = it.next();
        hasChanges = classify(prevBlock, currentBlock, nextBlock) | hasChanges;
      }
      prevBlock = currentBlock;
      currentBlock = nextBlock;
      nextBlock = TextBlock.EMPTY_START;
      hasChanges = classify(prevBlock, currentBlock, nextBlock) | hasChanges;
    }

    return hasChanges;
  }

  protected boolean classify(final TextBlock prev, final TextBlock curr, final TextBlock next) {
    final boolean isContent;

    if (curr.getLinkDensity() <= 0.333333) {
      if (prev.getLinkDensity() <= 0.555556) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



streampipes-extensions/streampipes-pipeline-elements-experimental-flink/src/main/java/com/kohlschutter/boilerpipe/filters/english/NumWordsRulesClassifier.java [41:78]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    return INSTANCE;
  }

  public boolean process(TextDocument doc) throws BoilerpipeProcessingException {
    List<TextBlock> textBlocks = doc.getTextBlocks();
    boolean hasChanges = false;

    ListIterator<TextBlock> it = textBlocks.listIterator();
    if (!it.hasNext()) {
      return false;
    }
    TextBlock prevBlock = TextBlock.EMPTY_START;
    TextBlock currentBlock = it.next();
    TextBlock nextBlock = it.hasNext() ? it.next() : TextBlock.EMPTY_START;

    hasChanges = classify(prevBlock, currentBlock, nextBlock) | hasChanges;

    if (nextBlock != TextBlock.EMPTY_START) {
      while (it.hasNext()) {
        prevBlock = currentBlock;
        currentBlock = nextBlock;
        nextBlock = it.next();
        hasChanges = classify(prevBlock, currentBlock, nextBlock) | hasChanges;
      }
      prevBlock = currentBlock;
      currentBlock = nextBlock;
      nextBlock = TextBlock.EMPTY_START;
      hasChanges = classify(prevBlock, currentBlock, nextBlock) | hasChanges;
    }

    return hasChanges;
  }

  protected boolean classify(final TextBlock prev, final TextBlock curr, final TextBlock next) {
    final boolean isContent;

    if (curr.getLinkDensity() <= 0.333333) {
      if (prev.getLinkDensity() <= 0.555556) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



