Assimilation As Attraction: Computing Distance, Similarity, And Locality In Phonology