Make custom length.tokenizer function as indicated in the README.

The example from the README was not working. This makes it work. Probably not the best fix, but it is a start.