Various string metrics written in Python 3