nl_tokens: Turn an iterator into a bitmap .
pl_tokens: public static long materialize ( final IteratingRLW i , final BitmapStorage c , long <mask> ) { final long origMax = max ; while ( true ) { if ( i . getRunningLength ( ) > 0 ) { long L = i . getRunningLength ( ) ; if ( L > max ) L = max ; c . addStreamOfEmptyWords ( i . getRunningBit ( ) , L ) ; max -= L ; } long L = i . getNumberOfLiteralWords ( ) ; for ( int k = 0 ; k < L ; ++ k ) c . addWord ( i . getLiteralWordAt ( k ) ) ; if ( max > 0 ) { if ( ! i . next ( ) ) break ; } else break ; } return origMax - max ; }