Jori Mäntysalo (TAU)
unread,Aug 8, 2019, 3:56:17 AM8/8/19Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sage-...@googlegroups.com
Might be of interest to someone painting a bikeshed. I played a little
with Levenshtein module.
$ egrep --no-filename -R -o -w '[a-z]{4,15}' src/sage > /tmp/all
$ cat /tmp/all | sort | uniq -c | fgrep -w 1 | colrm 1 8 > /tmp/singles
$ cat /tmp/all | sort | uniq -c | fgrep -v -w 1 | colrm 1 8 > /tmp/nonsingles
And now
#!/bin/python
from Levenshtein import distance
f = open('/tmp/singles', 'r')
singles = f.readlines()
f.close()
f = open('/tmp/nonsingles', 'r')
nonsingles = f.readlines()
f.close()
for s in singles:
for w in nonsingles:
if distance(s, w) == 1:
print(s+" "+w)
break
This can be used to spot at few typos.
--
Jori Mäntysalo
Tampereen yliopisto - Ihminen ratkaisee