Change e letters to i in words: Difference between revisions
Content added Content deleted
(→{{header|Ruby}}: Add Ruby) |
|||
Line 1,368: | Line 1,368: | ||
26. welles => willis |
26. welles => willis |
||
done... |
done... |
||
</pre> |
|||
=={{header|Ruby}}== |
|||
<lang ruby>words = File.readlines("unixdict.txt").map(&:chomp) |
|||
words.each do |word| |
|||
next if word.size < 6 |
|||
next unless word.match?(/e/) |
|||
e2i = word.tr("e", "i") |
|||
next unless words.bsearch{|w| e2i <=> w} |
|||
puts "#{word.ljust(10)} -> #{e2i}" |
|||
end |
|||
</lang> |
|||
{{out}} |
|||
<pre>analyses -> analysis |
|||
atlantes -> atlantis |
|||
bellow -> billow |
|||
breton -> briton |
|||
clench -> clinch |
|||
convect -> convict |
|||
crises -> crisis |
|||
diagnoses -> diagnosis |
|||
enfant -> infant |
|||
enquiry -> inquiry |
|||
frances -> francis |
|||
galatea -> galatia |
|||
harden -> hardin |
|||
heckman -> hickman |
|||
inequity -> iniquity |
|||
inflect -> inflict |
|||
jacobean -> jacobian |
|||
marten -> martin |
|||
module -> moduli |
|||
pegging -> pigging |
|||
psychoses -> psychosis |
|||
rabbet -> rabbit |
|||
sterling -> stirling |
|||
synopses -> synopsis |
|||
vector -> victor |
|||
welles -> willis |
|||
</pre> |
</pre> |
||