Data update
This commit is contained in:
parent
8e4e15fa56
commit
72eb4943cb
1853 changed files with 35514 additions and 9441 deletions
|
|
@ -0,0 +1,12 @@
|
|||
def auto_abbreviate (string)
|
||||
words = string.split
|
||||
return nil unless words.present?
|
||||
(1..words.max_of(&.size)).each do |n|
|
||||
return n if words.map(&.[0, n]).to_set.size == words.size
|
||||
end
|
||||
"∞"
|
||||
end
|
||||
|
||||
File.read_lines("weekdays.txt").each_with_index do |line, i|
|
||||
puts "#{i+1}) #{auto_abbreviate(line)} #{line}"
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue