lib/phonos/analyzer.rb in phonos-1.2.1 vs lib/phonos/analyzer.rb in phonos-1.2.2
- old
+ new
@@ -92,11 +92,11 @@
f1 = {}
f2 = {}
data.each do |lang, words|
table = @cache.read "#{lang}_phonos"
unless table
- table = YAML.load_file "./share/#{lang}.yaml"
+ table = YAML.load_file File.expand_path("../../../share/#{lang}.yaml", __FILE__)
@cache.write "#{lang}_phonos", table
end
words.join('').each_char do |c|
char = stats[lang][c]
SCALES.each do |scale|
@@ -119,10 +119,9 @@
end
end
end
end
SCALES.inject({}) do |r, scale|
- p f1, f2
val = if f1[scale] && f2[scale]
f1[scale] / f2[scale]
else
1.0
end