Python: Statistical String Comparison