Textonyms: Difference between revisions
→{{header|Ruby}}
No edit summary |
|||
Line 64:
=={{header|Ruby}}==
<lang ruby>
File.open("Textonyms.txt") do |file|
file.each_line {|line|
}
end
</lang>
{{out}}
<pre>
puts "There are #{Textonyms.inject(0){|n,g| n+g[1].length}} words in #{"http://rosettacode.org/wiki/Textonyms/wordlist"} which can be represnted by the Textonyms mapping."
puts "They require #{Textonyms.length} digit combinations to represent them."
There are 132916 words in http://rosettacode.org/wiki/Textonyms/wordlist which can be represnted by the Textonyms mapping.
They require 117868 digit combinations to represent them.
</pre>
<pre>
puts Textonymes["7353284667"]
|