ready do upload

This commit is contained in:
Senad Uka
2013-12-08 09:39:43 +01:00
parent 6d55768105
commit 2b9ea625d8
16 changed files with 2258 additions and 18 deletions

18
utils/filtriraj.rb Normal file
View File

@@ -0,0 +1,18 @@
# encoding: utf-8
rijeci = []
File.readlines('rijeci.txt').each do |line|
word_regex = /^(?<rijec>\p{Word}{4,10}),(?<definicija>.*)$/
matches = word_regex.match(line)
unless matches.nil?
rijeci << { :rijec => matches[:rijec] , :definicija => matches[:definicija] }
end
end
rijeci.sort! { |x,y| x[:rijec].length <=> y[:rijec].length }
rijeci.each do |rijec|
puts rijec[:rijec] + " - " + rijec[:definicija]
end