summaryrefslogtreecommitdiff
path: root/svm-light-fmt-fake
blob: eb074c101e00abb6c50019ee1499b9681bf8add9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env ruby

while line = STDIN.gets
  a = line.split
  label = a.shift.to_f
  label *= -1
  a.map! { |i|
    k,v = i.split ":"
    v = v.to_f*-1
    "#{k}:#{v}"
  }
  puts "#{label} #{a.join ' '}"
end