Rakefile in sekka-1.2.4 vs Rakefile in sekka-1.4.0
- old
+ new
@@ -1,11 +1,12 @@
+# -*- coding: utf-8 -*-
# -*- mode: ruby; -*-
# Rakefile for Sekka
#
# Release Engineering:
# 1. edit the VERSION.yml file
-# 2. rake compile && rake test && rake gemspec && rake build
+# 2. rake compile && rake test && rake gemspec && gem build sekka.gemspec
# to generate sekka-x.x.x.gem
# 3. install sekka-x.x.x.gem to clean environment and test
# 4. rake release
# 5. gem push pkg/sekka-x.x.x.gem ( need gem version 1.3.6 or higer. Please "gem update --system" to update )
#
@@ -17,19 +18,24 @@
# DB= (default)
# DB=all dbm/tokyocabinet/redis
#
require 'rake'
+
+# generate `normal' and `azik' dictionary
+generateTypes = [ "N", "A" ]
+
begin
require 'jeweler2'
Jeweler::Tasks.new do |gemspec|
vh = Jeweler::VersionHelper.new "."
gemspec.version = vh.to_s
gemspec.name = "sekka"
gemspec.summary = "Sekka is a SKK like input method."
gemspec.description = "Sekka is a SKK like input method. Sekka server provides REST Based API. If you are SKK user, let's try it."
gemspec.email = "kiyoka@sumibi.org"
+ gemspec.license = 'New BSD'
gemspec.homepage = "http://github.com/kiyoka/sekka"
gemspec.authors = ["Kiyoka Nishiyama"]
gemspec.files = FileList['Rakefile',
'.gemtest',
'VERSION.yml',
@@ -53,11 +59,11 @@
"sekka-benchmark",
"sekka-path"]
gemspec.required_ruby_version = '>= 1.9.2'
gemspec.add_dependency( "eventmachine" )
gemspec.add_dependency( "memcache-client" )
- gemspec.add_dependency( "nendo", "= 0.6.5" )
+ gemspec.add_dependency( "nendo", "= 0.6.6" )
gemspec.add_dependency( "distributed-trie" )
gemspec.add_dependency( "rack" )
gemspec.add_dependency( "ruby-progressbar" )
end
rescue LoadError
@@ -68,11 +74,11 @@
task :default => [:test] do
end
task :compile do
# generate version.rb
- dictVersion = "1.3.1"
+ dictVersion = "1.4.0"
vh = Jeweler::VersionHelper.new "."
open( "./lib/sekka/sekkaversion.rb", "w" ) {|f|
f.puts( "class SekkaVersion" )
f.printf( " def self.version() \"%s\" end\n", vh )
f.printf( " def self.dictVersion() \"%s\" end\n", dictVersion )
@@ -157,20 +163,20 @@
task :alljisyo => [ :alljisyoS, :alljisyoL ]
task :alljisyoS => [ :jisyoS, :loadS, :dumpS ]
task :alljisyoL => [ :jisyoL, :loadL, :dumpL ]
task :jisyoS do
- [ "N", "A" ].each {|x|
+ generateTypes.each {|x|
sh "time ./bin/sekka-jisyo convert#{x} ./data/SKK-JISYO.L.201008 > ./data/SEKKA-JISYO.SMALL.#{x}"
sh "time ./bin/sekka-jisyo convert#{x} ./data/SKK-JISYO.L.hira-kata >> ./data/SEKKA-JISYO.SMALL.#{x}"
sh "time ./bin/sekka-jisyo convert#{x} ./data/SKK-JISYO.hiragana-phrase >> ./data/SEKKA-JISYO.SMALL.#{x}"
sh "time ./bin/sekka-jisyo convert#{x} ./data/SKK-JISYO.hiragana-phrase2 >> ./data/SEKKA-JISYO.SMALL.#{x}"
}
end
task :jisyoL do
- [ "N", "A" ].each {|x|
+ generateTypes.each {|x|
sh "time ./bin/sekka-jisyo convert#{x} ./data/SKK-JISYO.L.201008 > ./data/SEKKA-JISYO.LARGE.#{x}"
sh "time ./bin/sekka-jisyo convert#{x} ./data/SKK-JISYO.L.hira-kata >> ./data/SEKKA-JISYO.LARGE.#{x}"
sh "time ./bin/sekka-jisyo convert#{x} ./data/SKK-JISYO.fullname >> ./data/SEKKA-JISYO.LARGE.#{x}"
sh "time ./bin/sekka-jisyo convert#{x} ./data/SKK-JISYO.jinmei >> ./data/SEKKA-JISYO.LARGE.#{x}"
sh "time ./bin/sekka-jisyo convert#{x} ./data/SKK-JISYO.station >> ./data/SEKKA-JISYO.LARGE.#{x}"
@@ -178,36 +184,37 @@
sh "time ./bin/sekka-jisyo convert#{x} ./data/SKK-JISYO.hiragana-phrase2 >> ./data/SEKKA-JISYO.LARGE.#{x}"
}
end
task :loadS do
- [ "N", "A" ].each {|x|
+ generateTypes.each {|x|
sh "time ./bin/sekka-jisyo load ./data/SEKKA-JISYO.SMALL.#{x} ./data/SEKKA-JISYO.SMALL.#{x}.tch"
}
end
task :loadL do
- [ "N", "A" ].each {|x|
+ generateTypes.each {|x|
sh "time ./bin/sekka-jisyo load ./data/SEKKA-JISYO.LARGE.#{x} ./data/SEKKA-JISYO.LARGE.#{x}.tch"
}
end
task :dumpS do
- [ "N", "A" ].each {|x|
+ generateTypes.each {|x|
sh "time ./bin/sekka-jisyo dump ./data/SEKKA-JISYO.SMALL.#{x}.tch > ./data/SEKKA-JISYO.SMALL.#{x}.tsv"
}
end
task :dumpL do
- [ "N", "A" ].each {|x|
+ generateTypes.each {|x|
sh "time ./bin/sekka-jisyo dump ./data/SEKKA-JISYO.LARGE.#{x}.tch > ./data/SEKKA-JISYO.LARGE.#{x}.tsv"
}
end
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"
sh "ruby -I ./lib /usr/local/bin/nendo ./data/hiragana_phrase_in_wikipedia2.nnd ./data/wikipedia/ranking.txt > ./data/SKK-JISYO.hiragana-phrase"
+ sh "echo 'して //' >> ./data/SKK-JISYO.hiragana-phrase"
end
file "./data/wikipedia/jawiki.hiragana.txt" do
sh "zcat /tmp/jawiki.txt.gz | mecab --input-buffer-size=65536 -O wakati --output=/tmp/jawiki.wakati.txt"
sh "ruby -I ./lib /usr/local/bin/nendo ./data/hiragana_phrase_in_wikipedia.nnd /tmp/jawiki.wakati.txt > ./data/wikipedia/jawiki.hiragana.txt"