2010年1月18日月曜日

『数学ガール』を読んでます

今、寝る前とかに『数学ガール』シリーズの第3巻を読んでいます。
高校生の頃は数学が好きで、数学科に行きたいと思ったくらいだったのですが、時間がたつにつれて、数Iの内容も忘れてしまっていますが、このシリーズは楽しく深く学べるような気がします。
少なくともまた数学を勉強したいという気にさせてくれます。

その『数学ガール ゲーデルの不完全性定理』44ページより
人の心は具体例を圧縮する。無意識にパターンを探し、短い表現を見つけるのが人の心だ。

認知意味論の本に出てきそうな言葉です。
なんかピピッときました。

2010年1月15日金曜日

LDOCE5もEPWING化可能に

LDOCE5をFreepEPWINGでEPWING化するスクリプトが公開されていました。
LDOCE5 DVDをEPWING化する
対象は辞書本体のみのようですが、これまで4版を主に使っていたので、これはありがたいです。

さっそくやってみようと思い、Linuxでやってみました。
PerlのモジュールもFreePWINGもUbuntuではSynapticでパッケージインストールができたので、gaiji.plの改行コードをLFにするだけでスクリプトの実行はできたのですが、EPWINGのデータはできたものの、
外字の処理うまくいっていません

追記: うまくいきました。
なお、arialuni.TTFは、Microsoft Officeでユニバーサルフォントをインストールすると導入されるようです。

そこで推奨環境であるCygwinを導入しましたが、XML::DOMがCPANでインストールできません。困ったものです。(Active Perlのパスを無効にしたらよいかもという話もあるようなので、その辺りを中心にもう少しいじってみたいと思います。)



BNCwebもアップデートされましたし、EPWING for the classicsもアップデートされるなど、この年末年始で英語データ界(?)で急に動きがあったような気がします。



1/18/2010追記
ebwin.plを実行することで作成されるLDOCE5.mapをEBWinの外字フォルダに入れることで、正しく表示されるようになりました。
私のドキュメントの読み込み不足が原因でした。

OEDのEPWING化

ついにOED(CD-ROM版 3.0・3.1)のEPWING化ができるようになりました。
OED の EPWING 化に書かれている手順で変換できます。

OED on XYZZYを作られた方と同じ方ですが、もう本当に大感謝です。

EBStudioでの変換がうまくいかなかったのですが、作者様に問い合わせたところ、文字列バッファサイズを448000000にするとよいと教えていただいて、それでうまくいきました。

なお、EBStudioでmemory allocate error!!(stringT)というエラーになっても、EBStudioを再起動するだけでこのエラーが出なくなるということもありました。

2010年1月11日月曜日

modifiledBNCquery.pl

I've made some modifications to the query page of BNCweb so we can make queries rather easily.
Here's the screenshot.

This modified version offers the following functionality:
-You can easily build queries with pull-down menus.
-You can start a query by pressing the Enter key; you don't have to click on the [Start Query] button.
-The IME is disabled in the query box on IE and Firefox 3. (This is effective at least in a Japanese OS environment.)
-A brief manual is offered on the query page.

It is available under the terms of the GNU General Public License Version 3, and can be downloaded here: modifiedBNCweb20100111.zip

I hope this will be of any help, and any comments and suggestions will be welcome.

How to install BNCweb 4.3

The following procedure is based on my installation of BNCweb 4.3 on Ubuntu 9.10. Please make necessary changes according to the version of BNCweb and to your system environment.

First, install the following packages, if not installed yet.
apache2
mysql-server-5.0
libparse-recdescent-perl
flex
bison
libncurses5-dev
subversion



$ sudo mkdir /BNC_XML (* or whatever)
$ tar xvzfBNCweb_version_4.3.tar.gz
$ sudo mv ~/BNCweb_version_4.3 /BNC_XML/
$ cd /BNC_XML/BNCweb_version_4.3
$ sudo chmod -R 755 cgi-bin
$ sudo chmod -R 755 lib_files
$ svn export https://cwb.svn.sourceforge.net/svnroot/cwb/cwb/trunk cwb-3.0
$ cd cwb-3.0
modify "config.mk"
---
(line 41)
include $(TOP)/config/platform/linux
---
$ make clean
$ make depend
$ make all
$ sudo make install
$ tar xvzf Perl-CWB-2.2.101.tar.gz
$ cd CWB
$ rm ._Makefile.PL
$ alias gtar='COPYFILE_DISABLE=true tar'
$ perl Makefile.PL
$ make
$ sudo make install
$ tar xvzf Perl-CWB-CL-2.2.101.tar.gz
$ cd CWB-CL
$ rm ._Makefile.PL
$ make
$ sudo make install
$ sudo mkdir /usr/local/share/cwb
$ sudo mkdir /usr/local/share/cwb/registry
$ sudo mkdir /usr/local/share/cwb/data
$ sudo mkdir /BNC_XML/Texts
$ cd /BNC_XML/Texts
(copy texts.tar.gz on Disk 1 of BNC-XML to /BNC_XML/Texts/)
$ tar xvzf texts.tar.gz
$ sudo cd ../BNCweb_version_4.3/BNC_encoder/
$ sudo perl BNCweb/EncodeBNC.perl -n BNC-XML -M 1000 -f -v /usr/local/share/cwb/data/ /BNC_XML/Texts/
(* "-M 1000" specifies the allocated memory size (in MB).
It took more about 3.5 hours on a PC with Athlon X2 BE-2400 and 3GB memory.)
$ sudo perl BNCweb/MakeFreqTables.perl -n BNC-XML -M 1000 -f -v
(* It took about 30 minutes on my PC.)
$ cd ../lib_files
(modify "bncConfigXML.pm")
---
(line 51)
$bwWebServer = "http(s)://your.server.name.com";
(line 62)
$bwCorpus = "BNC-XML";
(line 114)
$bwSuperuser = 'your_account'; (specify the administrative account)
---
$ sudo mkdir /usr/local/share/bncweb
$ sudo chmod 777 /usr/local/share/bncweb
$ cd ../BNC_encoder
$ sudo perl ../setup/make_MySQL_tables.pl
(When asked for the directory and prefix of the tables, just press [Enter].)
(* It took about 5 minutes on my PC.)
Configure the apache files.
Add the following lines into the appropriate apache config file.
(e.g. just before "</VirtualHost>" in /etc/apache2/sites-available/ssl)
---
Alias /bncweb/ /BNC_XML/BNCweb_version_4.3/
Alias /bncweb /BNC_XML/BNCweb_version_4.3/
ScriptAlias /bncweb-cgi/ /BNC_XML/BNCweb_version_4.3/cgi-bin/
<Directory /BNC_XML/BNCweb_version_4.3>
Options Indexes FollowSymLinks ExecCGI
AuthType Basic
AuthName bncweb
AuthUserFile /etc/bncpass
require valid-user
SetEnv PERL5LIB /BNC_XML/BNCweb_version_4.3/lib_files
</Directory>
---
Restart apache2.
Set the password for each user.
$ sudo htpasswd /etc/bncpass [username]
(Add -c option (htpasswd -c /etc/bncpass [username]) when you add the first user.)
Edit /etc/apparmor.d/usr.sbin.mysqld and add the following line befor the "}" at the end of the file:
---
/usr/local/share/bncweb/* rw,
---
$ sudo /etc/init.d/apparmor restart
$ sudo /etc/init.d/mysql restart
This enables MySQL to write a file to /usr/local/share/bncweb/.
Now access the site: http(s)://hostname/bncweb-cgi/BNCweb.pl
The interface of BNCweb will appear.

2010年1月6日水曜日

(笑)→藁→w

「(笑)」「藁」「w」日々進化した「ネットスラング」編
ここ最近の省力化の流行は「wkwk」「kwsk」「ktkr」など「頭文字をとりました型」だ。これらはそれぞれ「ワクワク」「くわしく」「来たコレ」(来たーーーーーーっ!!!の変化形。

言語変化を引き起こす要因のひとつに「省力化」があり、まさにこれらはその典型例であると言えます。
ちなみに全角のwの方が「それらしい」感じが出ているような気もします。半角と全角でニュアンスが違ったりということもあるのでしょうかね?

英語圏でも似たような現象が多く起きています。
インターネット上で用いられるスラングや表現法を(ネットスピーク」(netspeak)と言いますが、そこでもやはり省略が多用されます。
最近は特に携帯のメールで独特の表記法が使われるようになってきました。
それに関連して面白い新聞(International Herald Tribune)の記事を紹介します。
The revenge of e.e. cummings
記事自体がテキスト・メッセージング風に書かれていて、その特徴が凝縮されています。
こういう書き方ばかりをしていては駄目だということです。

きちんとした読み書きを意識的に訓練することは、子どもの時にはもちろん、大人になっても極めて重要だと思う今日この頃です。