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; }
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; }
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; }
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; }