01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
2008 : 01 02 03 04 05 06 07 08 09 10 11 12
2007 : 01 02 03 04 05 06 07 08 09 10 11 12
2006 : 01 02 03 04 05 06 07 08 09 10 11 12
2005 : 01 02 03 04 05 06 07 08 09 10 11 12
Web上リソース Hindi web-based computational linguistic resources
本場 Resource Center for Indian Language Technology Solutions (CFILT)
言語学・語学 Hindi Links
Wiktionaryも1000語くらいはあるっぽい。
番外 Link Grammar Language in India
国会議事録 英語 ヒンディー(PDF)
<http://scala.epfl.ch/>
yet another JVM language
OOな継承と総称プログラミングができて、
関数型なパタンマッチとカリー化ができて、
closure と 中置記法ができて、
Java VM と .NET で走るバイナリにコンパイルできる。
Java のクラスファイルとは自由にリンクできる。
object Test { def main(args: Array[String]) = { Console.println("Hello, World!") } }
…ことはできないので、
.bat を付加した名前でバッチファイルを作る。
たとえば fairlatex.rb なら、
@echo off e: ruby e:\mydoc\bin\fairlatex.rb %1 %2 %3 %4 %5これをパスの通ったディレクトリに置けば、fairlatex.rb という名前で実行できる。
$TEXMF/fonts/truetype に msgothic.ttc, msmincho.ttc をコピーする。
(普通は必要ないが)
$TEXMF/web2c/texmf.cnf
-SYSTTF = c:/{winnt,windows,winnt35}/fonts//;c:/usr/sysfonts// +SYSTTF = c:/{winnt,windows,windows.1,winnt35}/fonts//;c:/usr/sysfonts//
-% rml H Ryumin-Light -% gbm H GothicBBB-Medium -% rmlv V Ryumin-Light -% gbmv V GothicBBB-Medium + +% rml H Ryumin-Light +% gbm H GothicBBB-Medium +% rmlv V Ryumin-Light +% gbmv V GothicBBB-Medium + +rml H msmincho.ttc +gbm H msgothic.ttc +rmlv V msmincho.ttc +gbmv V msgothic.ttc
<http://www.math.nagoya-u.ac.jp/~garrigue/home-j.html>
講義資料充実しています。
generics な継承とか。
import java.util.*; interface MultiMap<K,V> extends Map<K,Set<V>> { boolean put(K key, V value); } class MultiHashMap<K,V> extends HashMap<K,Set<V>> implements MultiMap<K,V> { public boolean put(K key, V value) { Set<V> s = get(key); if ( s == null ) { s = new HashSet<V>(); put(key, s); } return s.add(value); } } MultiMap<String,String> mmap = new MultiHashMap<String, String>(); mmap.put("ABC", "Abc"); mmap.put("ABC", "aBc"); mmap.put("ABC", "abC"); mmap.put("ABC", "Abc"); System.out.println(mmap); // ==> {ABC=[aBc, abC, Abc]}Vの配列を作ろうとして若干はまったので、メモ。
って、思っていたより強力。
switch とか iterator とか使えるし、
enum Color { RED, BLUE; } public class Test { public static void main(String[] args) { Color c = Color.RED; String s="s"; switch (c) { case RED: break; case BLUE: s = "a"; break; default: ; } System.out.println(s + c); for ( Color cc : Color.values() ) System.out.println(cc); } }
enum Color { RED (255, 0, 0), BLUE( 0, 0, 255); private final int r; private final int g; private final int b; Color(int r, int g, int b) { this.r = r; this.g = g; this.b = b; } public double red() { return (double)r/255; } public double green() { return (double)g/255; } public double blue() { return (double)b/255; } }
「あらゆる分岐を、メソッドのオーバーロードに帰着させる」というのは、
オブジェクト指向設計の「標準形」のひとつだと思う。
switch 文
void proc(var variable) { switch ( variable ) { case c1: ... break; case c2: ... break; } }は、
interface Procedure{ public void proc(); } class C1 implements Procedure { void proc(){ ... } } class C2 implements Procedure { void proc(){ } } Procedure p = ...; p.proc();とか。
<http://iris.usc.edu/Vision-Notes/bibliography/contents.html>
Computer Vision を中心とした関連分野文献へのポインタ。
<http://e8y.net/blog/2006/07/25/p126.html>
Plagger のプラグイン作成事例として、とても分かりやすい。
何気なく使われている、Filterのあわせ技に注目。
<http://shooting-star.myhome.cx/cygwin/cron.html>
Windows のサービスとして、cron を登録する。
登録するためのプログラムはCygwinに含まれている。
$ cygrunsrv -I cron -d "CYGWIN cron" \
-p /usr/sbin/cron \
-a -D -e "CYGWIN=ntsec nosmbntsec"
cvs -d repos get fltk svn co repos/trunk fltk
cvs update -dP svn update
cvs add name svn add name
rm -f name svn remove name
cvs remove name
mv name newname svn move name newname
cvs remove name
cvs add newname
cvs commit svn commit
cvs diff svn diff
cvs -d repos get -r foo fltk svn co repos/branches/foo fltk
svn co repos/releases/foo fltk
cvs update -r foo svn switch repos/branches/foo
svn switch repos/releases/foo
cvs tag foo svn copy repos/releases/foo
cvs tag -b foo svn copy repos/branches/foo
repos = username@cvs.sf.net:/cvsroot/fltk for CVS and
https://svn.easysw.com/public/fltk/fltk for Subversion.
via Subversion Quick-Start Guide - Fast Light Toolkit (FLTK)
public class Subarray { public static void main(String[] args) { Integer[] i = new Integer[1]; // i[0] = new String(""); はもちろん通らないけれども、 // 安全なはずの「上位型へのキャスト」を使うと ... ( (Object[])i )[0] = new String(""); } }
<http://www.intel.com/cd/software/products/asmo-na/eng/compilers/clin/219856.htm>
Intel C++ Compiler for Linux*Free Non-commercial Unsupported Compiler
icc は C++ のソースのみ、 C++ のライブラリとのリンクする。
icpc は いつも(Cのソースでも) C++ のライブラリとリンクする。
<http://shootout.alioth.debian.org/>
言語のベンチマーク。
#include <iostream> class Complex { private: const double re; const double im; public: Complex(double r = 0.0, double i = 0.0) : re(r), im(i) { std::cout << "constructor: " << *this << std::endl; } Complex(const Complex& c) : re(c.re), im(c.im) { std::cout << "copy constructor: " << *this << std::endl; } ~Complex() {} Complex operator=(const Complex& c) // field が immutable だと、デフォルトの代入はできない { return Complex(c); } friend Complex operator+(const Complex&, const Complex&); friend std::ostream& operator<<(std::ostream& s, const Complex&); }; Complex operator+(const Complex& c1, const Complex& c2) // const .. & がないと { // copy constructor が呼ばれる return Complex(c1.re + c2.re, c1.im + c2.im); } std::ostream& operator<<(std::ostream& s, const Complex& c) { return s << "(" << c.re << ", " << c.im << ")@" << &c; } template<class T> T add(const T& a, const T& b) { return a + b; } int main() { double x = add(10, 20); std::cout << x << std::endl; Complex c1(10.0, -10.0); Complex c2(-2); std::cout << "add<>()" << std::endl; Complex c3(add(c1, c2)); // same to add<Complex>(c1, c2) std::cout << c3 << std::endl << std::endl; std::cout << "operator+()" << std::endl; Complex c4(c1 + c3); std::cout << c4 << std::endl << std::endl; std::cout << "operator+(), substitution" << std::endl; Complex c5 = c2 + c4; Complex c6; c6 = c5; std::cout << c5 << std::endl << std::endl; c6 = 0; add<Complex>(1, 2); return 0; }
30
constructor: (10, -10)@0x22ccb0
constructor: (-2, 0)@0x22cca0
add<>()
constructor: (8, -10)@0x22cc90
(8, -10)@0x22cc90
operator+()
constructor: (18, -20)@0x22cc80
(18, -20)@0x22cc80
operator+(), substitution
constructor: (16, -20)@0x22cc70
constructor: (0, 0)@0x22cc60
copy constructor: (16, -20)@0x22cc50
(16, -20)@0x22cc70
constructor: (0, 0)@0x22cc30
copy constructor: (0, 0)@0x22cc40
constructor: (2, 0)@0x22cc10
constructor: (1, 0)@0x22cc00
constructor: (3, 0)@0x22cc20
operator+を外で2項関数として定義する理由は、
第一引数に関して暗黙の型変換を有効にするため。
ようするに、
Complex(0,1)+1 も
1+Complex(0,1) も書けるようにするため。
上の方はどうでもよくて、面白いのは最後のところ。
引数のデフォルト値と演算子オーバーロードができると、こんなこともできるんですね...
<http://perldoc.perl.org/index-pragmas.html>
Perl の基本構文をオーバーライドするプラグマ。
演算子オーバーロードもあった。
(via T先輩のソース)
#! /usr/bin/env perl use warnings; use strict; package Complex; use overload '+' => sub{ Complex->new(map $_[0]->{$_} + $_[1]->{$_}, qw/r i/)}, '""' => sub{ "($_[0]->{r}, $_[0]->{i})" }; sub new($;$$){ my($class,$r,$i) = @_; $r ||= 0; $i ||= 0; return bless {r => $r, i => $i}, $class; } 1; my $c = Complex->new(10) + Complex->new(0, 10); print "$c\n";
<http://ocw.mit.edu/OcwWeb/Mathematics/18-06Spring-2005/VideoLectures/index.htm>
1回目だけ視聴。
Row picture / Column picture ... 名前重要、ですね。
via 少年老い易く学成り難し
<http://www.jaist.ac.jp/~uehara/etc/graph-class/index.html>
<http://www.kmonos.net/alang/boost/>
STL の次は Boost。
STLもまだまだ勉強中だけど...
+STLのページ
+Standard Template Library プログラミング on the Web
+SGI - STL Programmer's Guide
boost::property_mapに書かれている concept というのは、Java の interface に近いのかな。
<http://citeseer.ist.psu.edu/35617.html>
オートマトンの最小化も、奥が深い。
すでにあるディレクトリを作業ディレクトリとして継続して使いたいときの import (相当の方法)
<http://subversion.tigris.org/faq.html#in-place-import>
# svn mkdir file:///root/svn-repository/etc \
-m "Make a directory in the repository to correspond to /etc"
# cd /etc
# svn checkout file:///root/svn-repository/etc .
# svn add apache samba alsa X11
# svn commit -m "Initial version of my config files"
<http://archive.idrc.ca/books/edit/eindex.html#sguide>
The Chicago Manual of Style
Indiana University Style Guide
<http://orwell.ru/library/others/style/index.htm>
<table align=center>
のような効果が欲しいとき使えるCSS。
table タグは使いたくないけれど、table タグの効果が欲しい。
ということで、
水平方向のmargin:autoと、
display:table を組み合わせる。
<h1 style="border:1px black solid; display:table; margin: 0 auto;">test</h1>
<http://www.ism.ac.jp/~fukumizu/ISM_lecture_2006/>
福水先生による。
+CMU
+Waterloo
+Palmkit
Palmkit のソースが一番丁寧に書かれていると思う。
waterloo は C++ 移植だけれども、基本的に CMU そのまんまという感じがする。
ただし、中国語・日本語への対応が追加されているとか。
性能は…やっぱりベンチマークとらないと。
<http://brondsema.net/blog/index.php/2005/05/03/using_cygwin_keychain_svn_ssh_and_tortoi>
c:\Cygwin\bin\bash.exe --login -c "/usr/bin/ssh %*"
日本語の音声を、キーボードを使って書き取る(人間音声認識)をやる方法。
1. 適当な文節区切りで、ローマ字うち。変換は(できる環境であっても)しない。
2. sumibiに貼りつけ or Emacs のsumibi-mode
3. 変換間違いを修正。
オンラインでやるのは 1. だけなので、速い。
以前、kakasi 使ってこの方法をやろうとしたけれど、
3. をやるUIがないので、削除追加が面倒すぎた。
ほんとうはカナで打ってやった方が速いかも。
(できないけど)
sumibi のレスポンスがもっと良ければ、実用的。
というか、入力という基本的 UI がネットワークインフラを
つねに要求しているというのが、困る。
文脈情報も取り込んだ、柔軟な変換の実現 <== Webをコーパスとする <== 機械学習的アプローチ
ふつうに、ローカルでデコードすればいいんじゃない?
学習には時間がかかるにしても、
デコードはそれほど重くないと思うのだけれど。
スペリング修正もあわせてやってくれるとありがたい。
<http://subversion.bluegate.org/doc/re28.html>
リポジトリが引っ越したときの、.svn の中身だけの書き換え。
[2006-06-26-1]代替
例えばホスト名が変更されたり、URLスキーマが 変更されたり、リポジトリパスURLの先頭部分のどこかが変更されるような場合もあるでしょう。
新しい作業コピーをチェックアウトするよりも、svn switchを使って作業コピーの中に記録されているすべての URL の 先頭部分を一括して 「書き換えて」 やるほうが良いでしょう。
この置換には --relocateオプションを使ってください。
SLM Toolkit には、N-gram 頻度計数のコマンドとフォーマットがある。
(idngram, n=2,3)
CMU の方は チェインハッシュ、
Pamkit は内部ハッシュを使っている。
そのうちベンチマークしてみよう。
test.text
a b r a c a d a b r a
test.idngram (ascii)
1 2 5 2
1 3 1 1
1 4 1 1
2 5 1 2
3 1 4 1
4 1 2 1
5 1 3 1
言語モデル作成キットとして以外の使い道もあるよ、と。
Palmkit (= CMU-Cambridge SLM Toolkit) は、
各ステップの処理が別コマンドになっていて、
ユーザーが好きなスクリプトで走らせられるようになっている。
評価実験をするときには、色々な訓練データを使ってやりたい。
新規データの追加をしたときには、それを検出してLMを生成して欲しい。
ということで make。
まだ訓練部分しかないですが。
本当は、1つの訓練データに対してオプションを変えて実験をするときに、
再利用可能な途中結果を利用できるようにしたい。
########################################## # commands TX2FQ = text2wfreq FQ2VC = wfreq2vocab TX2ID = text2idngram ID2LM = idngram2lm EVALLM = evallm ############################################ # data directories TRAINDIRS = train t1 t2 DEVELDIR = devel TESTDIR = test # files TEXT := $(foreach dir,$(TRAINDIRS),$(wildcard $(dir)/*.text)) .SUFFIXES: .text .wfreq .idngram .arpa all: train devel ############################################ train: $(ARPA) %.arpa: %.idngram %.vocab $(ID2LM) -vocab $*.vocab -idngram $< -arpa $@ %.idngram: %.text %.vocab $(TX2ID) -vocab $*.vocab $< $@ %.vocab: %.wfreq $(FQ2VC) $< $@ %.wfreq: %.text $(TX2FQ) $< $@ ############################################ develop: train ############################################ test: train
<http://www.ne.jp/asahi/hishidama/home/tech/windows/command.html>
net start
動いているサービスの一覧を表示する。UNIXのpsに近い?
管理ツールで表示される一覧において、状態が「開始」となっているもの。
net start サービス名
サービスを起動する。
管理ツールで名前をクリックし、左側のメニューから「サービスの開始」をクリックするのと同じ。
<http://openlab.jp/edict/letmesee/index.html.ja>
CGI動作の辞書ビューア。
データはFPWBOOKが使える。
作業は以下のとおり。
+ プログラムのインストール
/var/www/localhost/cgi-bin 以下に置く。
/etc/lighttpd/lighttpd.conf
/etc/lighttpd/mod_cgi.conf
で、index.rb を Index として扱うようにする。
+ 辞書データ
FPWBOOK からダウンロード。
unzip で展開。
できたディレクトリを /usr/share/dicts 以下に置く。
/var/www/localhost/cgi-bin/letmesee/letmesee.conf
で、辞書ファイルの置き場とか、テーマを設定。
<http://www.gentoo.org/doc/en/gcc-upgrading.xml>
gcc のバージョン変えたときは、忘れずに。
<http://www.sodan.org/~knagano/emacs/dotemacs.html>
emacs-lisp の例外処理。
(defmacro eval-safe (&rest body) "安全な評価。評価に失敗してもそこで止まらない。" `(condition-case err (progn ,@body) (error (message "[eval-safe] %s" err))))
(load 'some-module)
と書いてあると、some-module が見つからない場合に、
それ以降の評価がされない。
(eval-safe (load 'some-module))
なら、エラーは message バッファに残り、
評価は続けられる。
とりあえず、↓にいろいろ書いてある。
XCoLinux - coLinux
coLinux側にVNCを入れるというのが、
一番軽く動くらしい。
とりあえず、ssh X11Forwarding を採用。
coLinux は Gentoo で動いてる。
いつもはまるのだけれど、Gentoo での sshd の初期設定は、
X11Forward no
これを yes にしておかないと、X転送ができない。
hosts ファイル。
<http://vine-linux.ddo.jp/windows/hosts.php>
WindowsNT/2000/XP : %SystemRoot%\SYSTEM32\Drivers\etc
Windows9x/Me : %SystemRoot%
2008 : 01 02 03 04 05 06 07 08 09 10 11 12
2007 : 01 02 03 04 05 06 07 08 09 10 11 12
2006 : 01 02 03 04 05 06 07 08 09 10 11 12
2005 : 01 02 03 04 05 06 07 08 09 10 11 12
最終更新時間: 2009-02-01 00:57
Powered by chalow