class LingPipeSentenceDetector implements SentenceDetector {

    @Override
    public Iterator<Token> iterateTokens(final String text) {
        Validate.notNull(text, "text must not be null");
        Chunking chunking = sentenceChunker.chunk(text);
        final Iterator<Chunk> chunkIterator = chunking.chunkSet().iterator();
        return new AbstractIterator<Token>() {
            @Override
            protected Token getNext() throws Finished {
                if (chunkIterator.hasNext()){
                    Chunk chunk = chunkIterator.next();
                    int start = chunk.start();
                    int end = chunk.end();
                    String value = text.substring(start, end);
                    return new ImmutableToken(start, value);
                }
                throw FINISHED;
            }
        };
    }

    public  LingPipeSentenceDetector();

}