Abbreviations, automatic: Difference between revisions
Content deleted Content added
→{{header|Ruby}}: Removed in-code data |
|||
Line 2,448: | Line 2,448: | ||
<lang ruby>require "abbrev" |
<lang ruby>require "abbrev" |
||
list = " Sunday Monday Tuesday Wednesday Thursday Friday Saturday |
|||
Sondag Maandag Dinsdag Woensdag Donderdag Vrydag Saterdag |
|||
E_djelë E_hënë E_martë E_mërkurë E_enjte E_premte E_shtunë |
|||
Ehud Segno Maksegno Erob Hamus Arbe Kedame |
|||
Al_Ahad Al_Ithinin Al_Tholatha'a Al_Arbia'a Al_Kamis Al_Gomia'a Al_Sabit |
|||
Guiragui Yergou_shapti Yerek_shapti Tchorek_shapti Hink_shapti Ourpat Shapat |
|||
domingu llunes martes miércoles xueves vienres sábadu |
|||
Bazar_gÜnÜ Birinci_gÜn Çkinci_gÜn ÜçÜncÜ_gÜn DÖrdÜncÜ_gÜn Bes,inci_gÜn Altòncò_gÜn |
|||
Igande Astelehen Astearte Asteazken Ostegun Ostiral Larunbat |
|||
Robi_bar Shom_bar Mongal_bar Budhh_bar BRihashpati_bar Shukro_bar Shoni_bar" |
|||
File.read("daynames.txt").each_line do |line| |
|||
next if line.strip.empty? |
|||
abbr = line.split.abbrev.invert |
abbr = line.split.abbrev.invert |
||
puts "Minimum size: #{abbr.values.max_by(&:size).size}" |
puts "Minimum size: #{abbr.values.max_by(&:size).size}" |
||
Line 2,496: | Line 2,486: | ||
Minimum size: 4 |
Minimum size: 4 |
||
{"Robi_bar"=>"R", "Shom_bar"=>"Shom", "Mongal_bar"=>"M", "Budhh_bar"=>"Bu", "BRihashpati_bar"=>"BR", "Shukro_bar"=>"Shu", "Shoni_bar"=>"Shon"} |
{"Robi_bar"=>"R", "Shom_bar"=>"Shom", "Mongal_bar"=>"M", "Budhh_bar"=>"Bu", "BRihashpati_bar"=>"BR", "Shukro_bar"=>"Shu", "Shoni_bar"=>"Shon"} |
||
(...) |
|||
</pre> |
</pre> |
||