About Me: Jawaad Mahmood: 30, Muslim, Canadian, freelance, doing consulting in Tokyo, Japan.

It’s festival season in Japan.

July 20, 2009

Like everything else, the festivals run exactly on time; 6:00-7:40. I still think there is something perverse about scheduling enjoyment, but maybe that is just me…

Comments Off

How many radicals are there for the basic 2000 Japanese Kanji anyway?

July 10, 2009

I am working on this Kanji dictionary program that helps sort out similar-looking (but different-meaning) words. I found an open source dictionary (kradfile) and was doing some analysis on it when I came across a total of 252 radicals (shown below). However, a popular online list has 214 radicals. What’s up?

[0] => 匕 [1] => ノ [2] => 勹 [3] => ヨ [4] => 亠 [5] => 厶 [6] => 川 [7] => 一 [8] => | [9] => 二 [10] => ハ [11] => 衣 [12] => ⺅ [13] => 口 [14] => 大 [15] => 矢 [16] => 廾 [17] => 文 [18] => 斉 [19] => 并 [20] => 木 [21] => 王 [22] => 羊 [23] => 耒 [24] => 日 [25] => 白 [26] => 入 [27] => 冂 [28] => 凵 [29] => 儿 [30] => 冖 [31] => 冫 [32] => 刀 [33] => 工 [34] => 丶 [35] => 力 [36] => 九 [37] => 生 [38] => 十 [39] => 又 [40] => 尸 [41] => 巾 [42] => 父 [43] => 田 [44] => 彑 [45] => 水 [46] => 月 [47] => 西 [48] => 門 [49] => 亅 [50] => 彳 [51] => 金 [52] => 土 [53] => 長 [54] => 女 [55] => 宀 [56] => 耳 [57] => 禸 [58] => 虫 [59] => 夂 [60] => ⻖ [61] => 人 [62] => 寸 [63] => 厂 [64] => 山 [65] => 干 [66] => 而 [67] => 鬼 [68] => 小 [69] => 示 [70] => 灬 [71] => 鳥 [72] => 几 [73] => 夕 [74] => 豆 [75] => 心 [76] => 忄 [77] => 爪 [78] => 扌 [79] => 手 [80] => 臼 [81] => 隹 [82] => 卜 [83] => 子 [84] => 幺 [85] => 攵 [86] => 至 [87] => 戈 [88] => 刂 [89] => 𠆢 [90] => 穴 [91] => 谷 [92] => 屮 [93] => 爿 [94] => 目 [95] => 罒 [96] => 自 [97] => 竹 [98] => 高 [99] => 欠 [100] => 氵 [101] => 广 [102] => 羽 [103] => 革 [104] => 火 [105] => 卩 [106] => 士 [107] => 牛 [108] => 乙 [109] => 犭 [110] => 屯 [111] => ⺾ [112] => 疒 [113] => 貝 [114] => 禾 [115] => 頁 [116] => 缶 [117] => 見 [118] => 毛 [119] => 亀 [120] => 世 [121] => 米 [122] => 戸 [123] => 糸 [124] => 聿 [125] => ⺌ [126] => 匚 [127] => 臣 [128] => ⺹ [129] => 氏 [130] => 舌 [131] => 舟 [132] => 青 [133] => 風 [134] => 乃 [135] => 馬 [136] => 隶 [137] => 止 [138] => ⻏ [139] => 皿 [140] => 血 [141] => 衤 [142] => 雨 [143] => 角 [144] => 言 [145] => 豸 [146] => 足 [147] => 車 [148] => 酉 [149] => 食 [150] => 骨 [151] => 比 [152] => 黽 [153] => 弓 [154] => 疋 [155] => 斤 [156] => 彡 [157] => 井 [158] => 久 [159] => 廴 [160] => 也 [161] => 立 [162] => 辛 [163] => マ [164] => 五 [165] => 亡 [166] => 曰 [167] => 囗 [168] => 弋 [169] => 方 [170] => 及 [171] => 支 [172] => 犬 [173] => 用 [174] => 艮 [175] => 玄 [176] => 歹 [177] => ユ [178] => 冊 [179] => 母 [180] => 毋 [181] => 辰 [182] => 已 [183] => 巴 [184] => 里 [185] => 免 [186] => 非 [187] => 奄 [188] => 虍 [189] => 甘 [190] => 走 [191] => 韋 [192] => 勿 [193] => 音 [194] => 面 [195] => 舛 [196] => 豕 [197] => 品 [198] => 黄 [199] => 癶 [200] => 尢 [201] => 尤 [202] => 无 [203] => 齊 [204] => 辶 [205] => 無 [206] => 黒 [207] => 鹿 [208] => 元 [209] => 牙 [210] => 巛 [211] => 岡 [212] => 矛 [213] => 鼻 [214] => 石 [215] => 身 [216] => 殳 [217] => 瓜 [218] => 肉 [219] => 行 [220] => 鬲 [221] => 麻 [222] => 歯 [223] => 首 [224] => 赤 [225] => 魚 [226] => 竜 [227] => 爻 [228] => 斗 [229] => 皮 [230] => 片 [231] => 滴 [232] => 韭 [233] => 釆 [234] => 巨 [235] => 邑 [236] => 气 [237] => 鼠 [238] => 礻 [239] => 色 [240] => 香 [241] => 鹵 [242] => 龠 [243] => 瓦 [244] => 鼓 [245] => 黍 [246] => 飛 [247] => 髟 [248] => 鬥 [249] => 鬯 [250] => 麦 [251] => 黹 [252] => 鼎

If you want to duplicate the result yourself, here is the PHP code to use.


$krad_input = file_get_contents(dirname(__FILE__) . "/krad.txt");
$krad_array = explode("\n", $krad_input);
unset($krad_input);
$total = count($krad_array);
$i = 0;
$radicalarray = array();
$stored = array();
while ($i < $total){
$string = $krad_array[$i];
if (substr($string, 0, 1) != "#"){
$kanji_and_radicals = extract_kanji_and_radicals($string);
//print_r($kanji_and_radicals);
foreach($kanji_and_radicals['radicals'] as $radical){
if (!isset($stored[$radical])){
$stored[$radical] = 1;
$radicalarray[] = $radical;
}
}
// We know the Kanji. We know its radicals. We can insert it into the database.
}
$i++;
}
print_r($radicalarray);
\n
function extract_kanji_and_radicals($string){
$regex = "`(\s:\s|\s+)`imus";
$matches = preg_split($regex, $string);
$return['kanji'] = $matches[0];
array_shift($matches);
$return['radicals'] = $matches;
return $return;
}

You can get the dictionary file from Kanjicafe.com.

-edit-
Curiouser and curiouser, it seems that the classic number is 212. There are a bunch of radicals in there that simply do not exist classically; perhaps they are an amalgamation of the radicals available in all the various Japanese-English dictionaries? (In some cases the radicals were altered to more closely suit the kanji itself)

Comments (1)

The Emobile D02HW, Pidgin, and how to deal with “Waiting for Network Connection”

July 9, 2009

I can’t believe I just wasted 2 hours fixing this stupid problem.

First the problem lies with network-manager. It doesn’t play well with EMobile and there is no simple way to connect with the modem directly from 9.04. (I read some chatter about modifying the 10-modem.ifi file, but I think this only works with the D03HW.)

To connect, I’m using the pon/poff method, but you can also connect with wvdial. The config file that I’ve tested successfully with wvdial is as follows:

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Dial Command = ATDT
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
Phone = *99***1#
Password = em
Username = em

Finally, you need to disable network manager. I got these instructions from The HungryCoder.

  1. Click System -> Administration -> Services
  2. Choose Network Manager and click Stop and Disable
  3. You can stop it from command line using
    sudo service NetworkManager stop
  4. Restart Pidgin.

This also fixes the irritating Firefox “Offline” issues.

Comments Off
Previous PageNext Page
Archives 
July 2010 May 2010 April 2010 March 2010 February 2010 January 2010 December 2009 November 2009 October 2009 August 2009 July 2009 June 2009 May 2009 April 2009 March 2009 February 2009 January 2009 December 2008 November 2008 August 2008 July 2008 June 2008 May 2008 April 2008 March 2008 February 2008 January 2008 December 2007 November 2007 October 2007 July 2007 June 2007 May 2007 April 2007 March 2007 February 2007 January 2007 December 2006 November 2006 October 2006 September 2006 August 2006 July 2006 June 2006 May 2006 April 2006 March 2006 February 2006 January 2006 December 2005 November 2005 February 2005 December 2004 November 2004 October 2004 September 2004

Creative Commons License
All text and images under 1024 x 768 pixels on this site are licensed under a Creative Commons Attribution 3.0 Unported License.
I require a link back to the original page of the article/image. If the image/article
is not public (IE: It is not present in an article on the blog), you may not reproduce it without permission.