New text preprocessors

Added string length and term difference preprocessor functions.