Swift Implementation of Norvig's implemetation in Python