Guest User

Untitled

a guest
Feb 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. print "Läser in datafilen... "
  2. ordfil = File.open("/usr/share/dict/swedish").read.split
  3. print "OK!\n"
  4. puts "Processerar filen..."
  5. ordfil.each_with_index do |lord, li|
  6. horden = Array.new
  7. ordfil[li..ordfil.size].each do |xord|
  8. horden << xord[lord.length..xord.length]
  9. break unless xord[0..lord.length] == lord
  10. end
  11. horden.each do |hord|
  12. ordfil.map {|ord| puts "word: #{lord + hord}\t#{lord}|#{hord}" if ord == hord }
  13. end
  14. end
Add Comment
Please, Sign In to add comment