Sha256: a9000b05021221841dc681a313a33f49e21b24fbe9c9ee7e31663edc312d0349

Contents?: true

Size: 869 Bytes

Versions: 49

Compression:

Stored size: 869 Bytes

Contents

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

$KCODE = 'u'

require 'kconv'

class String
  def to_json
    a = split(//).map {|char|
      case char
      when '"' then '\\"'
      when '\\' then '\\\\'
      when "\b" then '\b'
      when "\f" then '\f'
      when "\n" then '\n'
      when "\r" then ''
      when "\t" then '\t'
      else char
      end
    }
    "\"#{a.join('')}\""
  end
end

class Array
  def to_json
    '[' + map {|element|
      element.to_json
    }.join(',') + ']'
  end
end

puts <<END
column_create item_dictionary gene95_desc COLUMN_SCALAR ShortText
column_create bigram item_dictionary_gene95_desc COLUMN_INDEX|WITH_POSITION item_dictionary gene95_desc
load --table item_dictionary
[["_key","gene95_desc"],
END

while !STDIN.eof?
  key = Kconv.toutf8(gets.strip)
  body = Kconv.toutf8(gets.strip)
  puts [key, body].to_json
end
puts ']'

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
rroonga-4.0.1-x86-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-4.0.1-x64-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-4.0.0-x64-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-4.0.0-x86-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.1.2-x64-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.1.2-x86-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.1.1-x64-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.1.1-x86-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.1.0-x64-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.1.0-x86-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.0.9-x64-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.0.9-x86-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.0.8-x86-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.0.8-x64-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.0.7-x86-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.0.6-x86-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.0.5-x86-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.0.4-x86-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.0.2-x86-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb
rroonga-3.0.1-x86-mingw32 vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb