Skip to content

Commit

Permalink
Make the evaluation task compatible with 1.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dustalov committed May 5, 2013
1 parent daf2d5d commit bb793d2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/tasks/evaluate.rake
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ task :evaluate => :petrovich do
errors << %w(lemma expected actual params)

CSV.open(filename, col_sep: "\t", headers: true).each do |row|
word, lemma = row['word'], row['lemma']
grammemes = row['grammemes'] ? row['grammemes'].split(',') : []
word = row['word'].force_encoding('UTF-8')
lemma = row['lemma'].force_encoding('UTF-8')

grammemes = if row['grammemes']
row['grammemes'].force_encoding('UTF-8').split(',')
else
[]
end

gender = grammemes.include?('мр') ? :male : :female

Expand Down

0 comments on commit bb793d2

Please sign in to comment.