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
記事自体がテキスト・メッセージング風に書かれていて、その特徴が凝縮されています。
こういう書き方ばかりをしていては駄目だということです。

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

2009年12月31日木曜日

よいお年を

今年もみなさんのご支援・励ましに支えられて、健康に一年を過ごすことができましたことに、心より感謝いたします。

研究面では、今年の成果は質・量ともに満足できる水準には程遠いものでした。来年は懸命に努力して成果を出さねばなりません。
授業も今年の反省を活かして、来年は今年よりもよい授業をしたいと思います。
日々努力と反省を重ね、しかし焦らず着実に、一歩一歩進んでいかねばと思っております。

2010年もよろしくお願いいたします。
2010年もみなさんにとって良い年となりますように。

2009年8月27日木曜日

ハイフン・マイナス・ダッシュの使い分けと入力方法

これまであまり意識せずに使ってきたハイフン・マイナス・ダッシュの記号の厳密な違いと入力方法について調べてみました。

hypen(‐): いわゆるハイフン (U+2010)
figure dash(‒): 電話番号など (U+2012)
minus sign(−): マイナス符号 (U+2212)
en dash(–): 範囲を示す (U+2013) WindowsではAltを押しながらテンキーで0150か、MS WordではCtrl+テンキーのマイナスで入力可。
em dash(—): いわゆるダッシュ (U+2014) WindowsではAltを押しながらテンキーの0151か、MS WordではCtrl+Alt+テンキーのマイナスで入力可。

MS WordでUnicode文字を入れるには、上記のU+の後の4桁を入力して、それからAlt+xで変換するという方法もあります。

キーボード上のハイフン・テンキー上のマイナス符号はいずれもhyphen-minus(U+002D)という、上記とはまた別の記号です。
しかし、一般にはこのhyphen-minusがfigure dash・hyphen・minus signを包摂するものとして広く使われていますので、特に厳密に区分する必要がなければ、ダッシュ以外のハイフン・マイナス系統にはこれを使っておけばいいでしょう。

なお、記号の前後のスペースの有無等についてはスタイル等で異なるようです。

2009年8月3日月曜日

夏休みまであと少し

前期も終わりが見えてきましたが、授業がない時にこそ集中して勉強せねばなりません。
NHKラジオ『実践ビジネス英語』2009年7月22日放送分のQuote ... Unquote (テキスト2009年7月号51ページ) より、自戒の念を込めて引用。
The man who does not read good books has no advantage over the man who can't read them. --Mark Twain (U.S. writer, 1835-1910)


2009年7月12日日曜日

BNCwebの改造版インターフェイス on Greasemonkey

BNCwebの改造版インターフェイスをちまちまと作って自分で使っていたわけですが、最大の欠点は自分で立てたサーバー上でしか使えないというものでした。
この欠点を克服して誰でも使えるように、Firefox + Greasemonkeyのスクリプトで対応できるようにしたものを現在作成しています。
基本機能は今日一日でほぼできたので、もう少し細かいところを詰めた上で近々公開したいと思います。