Rakefile in sekka-1.6.2 vs Rakefile in sekka-1.6.3

- old
+ new

@@ -21,11 +21,11 @@ require 'rake' require "bundler/gem_tasks" require 'jeweler2' -dictVersion = "1.6.0" +dictVersion = "1.6.1" task :default => [:test] do end @@ -77,10 +77,13 @@ end ["test.record", "test.tch", "test.db" ].each {|name| File.unlink( name ) if File.exist?( name ) } + ["test.ldb"].each {|name| + FileUtils.rm_rf( name ) if File.exist?( name ) + } files = [] files << "./test/memcache.nnd" files << "./test/util.nnd" files << "./test/alphabet-lib.nnd" files << "./test/sharp-number.nnd" @@ -92,23 +95,28 @@ case ENV['DB'] when 'gdbm' files << "./test/henkan-main.nnd gdbm" when 'tokyocabinet' files << "./test/henkan-main.nnd tokyocabinet" + when 'leveldb' + files << "./test/henkan-main.nnd leveldb" when 'redis' files << "./test/redis.nnd" files << "./test/henkan-main.nnd redis" when 'pure' files << "./test/henkan-main.nnd pure" + files << "./test/henkan-main.nnd leveldb" when 'all' files << "./test/henkan-main.nnd gdbm" files << "./test/henkan-main.nnd tokyocabinet" files << "./test/henkan-main.nnd redis" files << "./test/henkan-main.nnd pure" + files << "./test/henkan-main.nnd leveldb" else # default files << "./test/henkan-main.nnd tokyocabinet" files << "./test/henkan-main.nnd pure" + files << "./test/henkan-main.nnd leveldb" end files.each {|filename| sh sprintf( "ruby -I ./lib -S nendo -I ./lib -d %s", filename ) } sh "cat test.record" @@ -117,14 +125,15 @@ task :bench do sh "time nendo -I ./lib ./test/approximate-bench.nnd" sh "time nendo -I ./lib ./test/henkan-bench.nnd" end -task :alljisyo => [ :jisyo, :load, :dump, :md5 ] +task :alljisyo => [ :jisyo, :load, :dump, :load_leveldb, :md5 ] task :md5 do - sh sprintf( "md5sum ./data/SEKKA-JISYO-%s.N.tsv > ./data/SEKKA-JISYO-%s.N.md5", dictVersion, dictVersion ) + sh sprintf( "md5sum ./data/SEKKA-JISYO-%s.N.tsv > ./data/SEKKA-JISYO-%s.N.md5", dictVersion, dictVersion ) + sh sprintf( "md5sum ./data/SEKKA-JISYO-%s.N.ldb.tar.gz > ./data/SEKKA-JISYO-%s.N.ldb.tar.gz.md5", dictVersion, dictVersion ) end task :jisyo do sh "ruby ./bin/sekka-jisyo convertN ./data/SKK-JISYO.L.201501 > ./data/SEKKA-JISYO.N" sh "ruby ./bin/sekka-jisyo convertN ./data/SKK-JISYO.L.hira-kata >> ./data/SEKKA-JISYO.N" @@ -140,9 +149,14 @@ sh "ruby ./bin/sekka-jisyo load ./data/SEKKA-JISYO.N ./data/SEKKA-JISYO.N.tch#xmsiz=1024m" end task :dump do sh sprintf( "ruby ./bin/sekka-jisyo dump ./data/SEKKA-JISYO.N.tch#xmsiz=1024m > ./data/SEKKA-JISYO-%s.N.tsv", dictVersion ) +end + +task :load_leveldb do +# sh sprintf( "ruby ./bin/sekka-jisyo load ./data/SEKKA-JISYO.N ./data/SEKKA-JISYO-%s.N.ldb", dictVersion ) + sh sprintf( "tar zcCf ./data ./data/SEKKA-JISYO-%s.N.ldb.tar.gz ./SEKKA-JISYO-%s.N.ldb" , dictVersion, dictVersion ) end # SKK-JISYO.hiragana-phrase はWikipediaから作られる。 task :phrase => [ "/tmp/jawiki.txt.gz", "./data/wikipedia/jawiki.hiragana.txt" ] do sh "sort ./data/wikipedia/jawiki.hiragana.txt | uniq -c | sort > ./data/wikipedia/ranking.txt"