横浜に引っ越しました
諸事情があり、横浜に引っ越しました。家賃高いだけあり、かなり快適なお家。
大きめなスーパーまで歩いて行けて、レストランもたくさんと、暮らしやすそう。
部屋の中はまだまだ箱箱ランド。インターネットはまだ開通していない。これが結構辛いかも。
会社も遠いけれど仕方がないか、という感じです。
箱箱ランド
眠れないので今更 Suffix Array の話でもかくか
いま、Suffix Arrayを使って新しい手法を作ろうと画策している。基本的には、Katsuradaらの手法 (PDF)の応用である。しばらくは、既存の知識の応用で成果を出していく。もちろん、何に応用するかは言えない。
この手法はSuffix Arrayをつかって、音声検索語検出を高速に行うものである。Suffix Arrayについては検索すればいくらでも詳しい情報が得られるため、詳説しない。大雑把にいうなら、巨大なドキュメントに対してインデックを貼りまくって、二分探索する感じである。メモリ効率を犠牲にして高速化を行う、現代的なアルゴリズムだ。
Suffix Array自体の構築方法としては、Induction Sort(IS)と呼ばれる手法が高速である。詳細は以下の文献を参考にしてほしい。
Nong, G., Nong, G., Zhang, S., Zhang, S., Chan, W. H., & Chan, W. H. (2008). Two Efficient Algorithms for Linear Suffix Array Construction. Draft, 60(October), 25
実装については,sais が良いとのことである。
この後、ごにょごにょして性能が上がると予測している。
選択と集中、あるいは野望
How to fix Gradle-D-plugin
I want to use Gradle as D language build tool. But it is not supported. However there is Gradle D plugin on GitHub. Though it's not able to build.
GitHub - DirectCodeGraveyard/Gradle-D-plugin: Adds the D language support to gradle
# gradle build
:compileJava UP-TO-DATE
:compileGroovy UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar UP-TO-DATE
:assemble UP-TO-DATE
:compileTestJava UP-TO-DATE
:compileTestGroovystartup failed:
/home/masashi/etc/Gradle-D-plugin/src/test/groovy/com/directmyfile/DPluginTest.groovy: 13: unable to resolve class CompileTask
@ line 13, column 54.
ect.tasks.compileD instanceof CompileTas
^/home/masashi/etc/Gradle-D-plugin/src/test/groovy/com/directmyfile/CompileTaskTest.groovy: 13: unable to resolve class CompileTask
@ line 13, column 36.
assertTrue(task instanceof CompileTask)
^2 errors
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileTestGroovy'.
> Compilation failed; see the compiler error output for details.* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.BUILD FAILED
It is very easy to fix. Apply this patch.
Index: etc/Gradle-D-plugin/src/main/groovy/com/directmyfile/tasks/CompileTask.groovy
===================================================================
--- etc.orig/Gradle-D-plugin/src/main/groovy/com/directmyfile/tasks/CompileTask.groovy
+++ etc/Gradle-D-plugin/src/main/groovy/com/directmyfile/tasks/CompileTask.groovy
@@ -11,7 +11,7 @@ class CompileTask extends DefaultTask {
String linkedName
String srcDir = "src/main/d"
- String compiler = "dmd"
+ String compiler = "gdc"
List<String> opts = []
Index: etc/Gradle-D-plugin/src/test/groovy/com/directmyfile/CompileTaskTest.groovy
===================================================================
--- etc.orig/Gradle-D-plugin/src/test/groovy/com/directmyfile/CompileTaskTest.groovy
+++ etc/Gradle-D-plugin/src/test/groovy/com/directmyfile/CompileTaskTest.groovy
@@ -9,7 +9,7 @@ class CompileTaskTest {
@Test
public void canAddTaskToProject() {
Project project = ProjectBuilder.builder().build()
- def task = project.task('compileD', type: CompileTask)
- assertTrue(task instanceof CompileTask)
+ def task = project.task('compileD', type: com.directmyfile.tasks.CompileTask)
+ assertTrue(task instanceof com.directmyfile.tasks.CompileTask)
}
}
Index: etc/Gradle-D-plugin/src/test/groovy/com/directmyfile/DPluginTest.groovy
===================================================================
--- etc.orig/Gradle-D-plugin/src/test/groovy/com/directmyfile/DPluginTest.groovy
+++ etc/Gradle-D-plugin/src/test/groovy/com/directmyfile/DPluginTest.groovy
@@ -10,6 +10,6 @@ class DPluginTest {
public void greeterPluginAddsGreetingTaskToProject() {
Project project = ProjectBuilder.builder().build()
project.apply plugin: 'd'
- assertTrue(project.tasks.compileD instanceof CompileTask)
+ assertTrue(project.tasks.compileD instanceof com.directmyfile.tasks.CompileTask)
}
}
It is optional to change the compiler dmd to gdc.
# gradle build
:compileJava UP-TO-DATE
:compileGroovy
:processResources
:classes
:jar
:assemble
:compileTestJava UP-TO-DATE
:compileTestGroovy
:processTestResources UP-TO-DATE
:testClasses
:test
:check
:buildBUILD SUCCESSFUL
I know nothing about gradle. It is only able to change it buildable.
It runs only dmd... But I will try it more sophisticated code. Today I'm tired.