Calculate statistics on text