public static IChunk [ ] getSmallestVarianceWordLengthChunks ( IChunk [ ] chunks ) { double smallestVariance = chunks [ 0 ] . getWordsVariance ( ) ; int j ; //find the smallest variance word length for ( j = 1 ; j < chunks . length ; j ++ ) { if ( chunks [ j ] . getWordsVariance ( ) < smallestVariance ) { smallestVariance = chunks [ j ] . getWordsVariance ( ) ; } } //get the items that the variance word length equals to //the max's. ArrayList < IChunk > chunkArr = new ArrayList < IChunk > ( chunks . length ) ; for ( j = 0 ; j < chunks . length ; j ++ ) { if ( chunks [ j ] . getWordsVariance ( ) == smallestVariance ) { chunkArr . add ( chunks [ j ] ) ; } } IChunk [ ] lchunk = new IChunk [ chunkArr . size ( ) ] ; chunkArr . toArray ( lchunk ) ; chunkArr . clear ( ) ; return lchunk ; }
the smallest variance word length this rule will the chunks that one the smallest variance word length