2002年11月12日(Tue) 今日はいい天気だ [同日]
● ドイツ語は関西弁に似ていなくもない
動詞の活用
- 僕 起きて
- 君 起きてすと
- 彼 起きてっと
- 僕たち 起きてん ←この辺
- あなたたち 起きてっと
- 彼ら 起きてん ←この辺
とか考えてたらはよ仕事いきなされと怒られた。
● そういうわけで遅刻〜
いい天気なので自転車。三輪車のでかいのをシベリアンハスキーに曳かせて、たぶん犬ソリの練習をしてる人がいたよ。
● iiimf-skkをdb3でコンパイルする
昨日の不具合は試したマシンに db4が入っていないことが原因でした。 考えてみたらdb4を入れればいいだけのハナシなのに、 famaoさんに暫定パッチを作っていただいてしまった。 http://sourceforge.jp/tracker/download.php?group_id=34&atid=212&file_id=149&aid=744をiiimf-skk-0.1.21-db3-tmp.patchとして保存して、 iiimf-skk.specを以下のように書き換えてオモコンしました。
--- iiimf-skk.spec.orig Mon Nov 11 08:53:08 2002 +++ iiimf-skk.spec Tue Nov 12 09:15:25 2002 @@ -6,17 +6,18 @@ Group: User Interface/X URL: http://www.momonga-linux.org/~famao/iiimf-skk/ Source: http://downloads.sourceforge.jp/iiimf-skk/1528/iiimf-skk-%{version}.tar.gz +Patch: iiimf-skk-0.1.21-db3-tmp.patch Requires: glib Requires: gtk+ Requires: skkserv -Requires: db4 +Requires: db3 Requires: iiimf Requires: iiimf_conv Requires: iiimf-xiiimp Requires: libxml2 BuildRequires: glib-devel BuildRequires: gtk+-devel -BuildRequires: db4-devel +BuildRequires: db3-devel BuildRequires: libxml2-devel BuildRoot: %{_tmppath}/%{name}-%{version}-root NoSource: 0 @@ -28,9 +29,10 @@ %prep %setup -q +%patch -p1 %build -%configure --enable-gtk2 +%configure make %install
● iiimf-skkの設定ファイルで遊ぶ
famaoさんに書いていただいたiiimf-skk-HOWTOの この辺を参考に、~/.iiimf-skk/config.xmlを
<?xml version="1.0" encoding="EUC-JP"?> <!DOCTYPE iiimf-skk [ <!ELEMENT iiimf-skk (item,rule)*> <!ELEMENT item (name, value, info)> <!ATTLIST item type (bool|string|num) "bool"> <!ELEMENT name (#PCDATA)> <!ELEMENT value (#PCDATA)> <!ELEMENT info (#PCDATA)> <!ELEMENT rule (key, katakana, hiragana, append)> <!ELEMENT key (#PCDATA)> <!ELEMENT katakana (#PCDATA)> <!ELEMENT hiragana (#PCDATA)> <!ELEMENT append (#PCDATA)> ]> <iiimf-skk> <rule> <key>hh</key> <katakana>ッ</katakana> <hiragana>っ</hiragana> <append>h</append> </rule> <item type="string"> <name>skk-jisyo</name> <value>/home/zunda/.iiimf-skk/skk-jisyo</value> <info>個人辞書(おくりなし)を格納するファイル名</info> </item> <item type="string"> <name>skk-okuri-jisyo</name> <value>/home/zunda/.iiimf-skk/skk-okuri-jisyo</value> <info>個人辞書(おくりあり)を格納するファイル名</info> </item> </iiimf-skk>
としてみました。「ザッハトルテ」もちゃんと出るよ。 明日は再読み込み機能を試してみよう。
● 最も短いGPLコンパチブルなライセンス
何かしようとするといっつも忘れるんだよな。
# Permission is granted for use, copying, modification, distribution, # and distribution of modified versions of this work as long as the # above copyright notice is included.
ruby-talkよりJim Weirichさん。
● rubyでnamazuのインデックスを読む
自分でどんな言葉を使っているのかちょっと興味があって、 こそこそコードを作ってみました。 namazuのインデックスからscoreを読んで、多い順に表示してくれる。
#!/usr/bin/env ruby # # Copyright 2002 zunda <zunda at freeshell.org> # Permission is granted for use, copying, modification, distribution, # and distribution of modified versions of this work as long as the # above copyright notice is included. # Nwords = 10 # class of a word class Word attr_accessor :count, :id, :word, :position, :score def initialize (id = 0, count = 0, score = 0, position = 0, word = '') @id = id @count = count @score = score @position = position @word = word end def to_s "#{word} --- #{count} counts with score: #{score}" end end # read the NMZ.* files nmz_wi=File.open ('NMZ.wi').read.unpack('N*') nmz_i=File.open ('NMZ.i').read.unpack('w*') # get into a shape words = Array.new i_index = 0 nmz_wi.length.times do |id| position = nmz_wi[id] # position of the word in NMZ.w count = nmz_i[i_index] / 2 # number of documents i_index += 1 # shift/pop costs much score = 0 count.times do i_index += 1 # skip the document ID score += nmz_i[i_index] # score in the document i_index += 1 end words << Word.new (id, count, score, position) end # sort the words in order of the score words.sort! do |a,b| b.score <=> a.score end # read the NMZ.w file file = File.open ('NMZ.w') words[0..Nwords].each do |word| file.seek (word.position, IO::SEEK_SET) word.word = file.gets.chomp end file.close # display the result words[0..Nwords].each do |word| puts word end
結果は…
● --- 218 counts with score: 7184 の --- 216 counts with score: 4917 。 --- 218 counts with score: 4696 を --- 218 counts with score: 3964 、 --- 209 counts with score: 3865 月 --- 218 counts with score: 3107 ) --- 218 counts with score: 3020 ( --- 218 counts with score: 2996 日 --- 218 counts with score: 2980 が --- 196 counts with score: 2018 に --- 195 counts with score: 1737
がっかり。 w3mで見ればわかりますが、この日誌のパラグラフアンカーは「●」なのです。 chasenでフィルターをするともうちょっとマシになるかもしれないけど。
[ツッコミを入れる]
最近のツッコまれどころ