<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dipplum.com &#187; 中文化</title>
	<atom:link href="http://dipplum.com/category/computer/chinese/feed/" rel="self" type="application/rss+xml" />
	<link>http://dipplum.com</link>
	<description>Be  the change you wanna see in the world</description>
	<lastBuildDate>Sat, 12 Nov 2011 07:38:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Python调用搜狗云输入法的小例子</title>
		<link>http://dipplum.com/2010/01/22/sogou-cloud-ime-python/</link>
		<comments>http://dipplum.com/2010/01/22/sogou-cloud-ime-python/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 17:52:20 +0000</pubDate>
		<dc:creator>li</dc:creator>
				<category><![CDATA[中文化]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[ime]]></category>
		<category><![CDATA[pinyin]]></category>
		<category><![CDATA[sogou]]></category>

		<guid isPermaLink="false">http://dipplum.com/2010/01/22/sogou-cloud-ime-python/</guid>
		<description><![CDATA[写了个Python的小例子，调用搜狗云输入法获取汉字。感谢xzap在搜狗论坛发布的bash脚本，但觉得bash还是略微晦涩了点，用python说明搜狗云输入法的API更加清晰一点。 #!/usr/bin/python from urllib import urlopen from cgi import parse_qs &#160; url = 'http://web.pinyin.sogou.com/web_ime/get_ajax/%s.key' &#160; py = raw_input&#40;'input pinyin: '&#41; res = urlopen&#40;url % py&#41;.read&#40;&#41; dic = parse_qs&#40;res&#41; lst = eval&#40;dic&#91;'ime_query_res'&#93;&#91;0&#93;&#41;.split&#40;'\t '&#41; words = map&#40;lambda x: x.split&#40;'\xef\xbc\x9a'&#41;&#91;0&#93;, lst&#41; counts = map&#40;lambda x: x.split&#40;'\xef\xbc\x9a'&#41;&#91;1&#93;, lst&#41; &#160; for i in range&#40;len&#40;words&#41;&#41;: print words&#91;i&#93;, counts&#91;i&#93; &#160; exit 运行该脚本的输出结果如下，每行前面是候选词/句，后面是该候选词/句消耗的英文单词字母个数： [...]]]></description>
			<content:encoded><![CDATA[<p>写了个Python的小例子，调用搜狗云输入法获取汉字。感谢xzap在搜狗论坛发布的<a href="http://pinyin.sogou.com/bbs/redirect.php?tid=140527&amp;goto=lastpost" target="_blank">bash脚本</a>，但觉得bash还是略微晦涩了点，用python说明搜狗云输入法的API更加清晰一点。</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python                                                                                                                                           </span>
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">urllib</span> <span style="color: #ff7700;font-weight:bold;">import</span> urlopen
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">cgi</span> <span style="color: #ff7700;font-weight:bold;">import</span> parse_qs
&nbsp;
url = <span style="color: #483d8b;">'http://web.pinyin.sogou.com/web_ime/get_ajax/%s.key'</span>
&nbsp;
py = <span style="color: #008000;">raw_input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'input pinyin: '</span><span style="color: black;">&#41;</span>
res = urlopen<span style="color: black;">&#40;</span>url <span style="color: #66cc66;">%</span> py<span style="color: black;">&#41;</span>.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
dic = parse_qs<span style="color: black;">&#40;</span>res<span style="color: black;">&#41;</span>
lst = <span style="color: #008000;">eval</span><span style="color: black;">&#40;</span>dic<span style="color: black;">&#91;</span><span style="color: #483d8b;">'ime_query_res'</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span> '</span><span style="color: black;">&#41;</span>
words = <span style="color: #008000;">map</span><span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">lambda</span> x: x.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\x</span>ef<span style="color: #000099; font-weight: bold;">\x</span>bc<span style="color: #000099; font-weight: bold;">\x</span>9a'</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>, lst<span style="color: black;">&#41;</span>
counts = <span style="color: #008000;">map</span><span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">lambda</span> x: x.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\x</span>ef<span style="color: #000099; font-weight: bold;">\x</span>bc<span style="color: #000099; font-weight: bold;">\x</span>9a'</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>, lst<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>words<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> words<span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span>, counts<span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span>
&nbsp;
exit</pre></div></div>

<p>运行该脚本的输出结果如下，每行前面是候选词/句，后面是该候选词/句消耗的英文<del datetime="2010-07-02T08:58:07+00:00">单词</del>字母个数：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>sogou.py
input pinyin: nihaosgysrf
你好搜狗云输入法 <span style="color: #000000;">11</span>
你好是 <span style="color: #000000;">6</span>
倪豪士 <span style="color: #000000;">6</span>
你好 <span style="color: #000000;">5</span>
拟好 <span style="color: #000000;">5</span>
倪浩 <span style="color: #000000;">5</span>
泥蒿 <span style="color: #000000;">5</span>
倪昊 <span style="color: #000000;">5</span>
倪皓 <span style="color: #000000;">5</span>
匿号 <span style="color: #000000;">5</span>
你 <span style="color: #000000;">2</span>
拟 <span style="color: #000000;">2</span>
呢 <span style="color: #000000;">2</span>
尼 <span style="color: #000000;">2</span>
泥 <span style="color: #000000;">2</span>
逆 <span style="color: #000000;">2</span>
妮 <span style="color: #000000;">2</span>
腻 <span style="color: #000000;">2</span>
倪 <span style="color: #000000;">2</span>
伱 <span style="color: #000000;">2</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://dipplum.com/2010/01/22/sogou-cloud-ime-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Firefox界面字体设置</title>
		<link>http://dipplum.com/2008/09/04/firefox-fonts/</link>
		<comments>http://dipplum.com/2008/09/04/firefox-fonts/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 16:02:27 +0000</pubDate>
		<dc:creator>li</dc:creator>
				<category><![CDATA[中文化]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[simsun]]></category>

		<guid isPermaLink="false">http://dipplum.com/?p=39</guid>
		<description><![CDATA[在Windows平台上用Firefox代替IE的最大困惑是, 觉得Firefox界面字体没有IE好看. 主要是因为Firefox默认使用Tahoma的9pt字体, 而IE沿用了Windows系统默认的8pt Tahoma字体. 如图1和图2所示: 图1: Firefox界面默认字体 图2: IE界面默认字体 我们可以通过Firefox支持的css界面定制, 让Firefox也用8pt字体. 如果是Windows, 就在C:\Documents and Settings\username\Application Data\Mozilla\Firefox\Profiles\xxxxxx.default\chrome目录下(其中username是Windows帐号名, xxxxxx是若干随机生成的字母数字组合), 创建一个userChrome.css文件, 内容如下: * { font-size: 8pt !important; font-family: tahoma, simsun !important } 下面图3和图4是Firefox在Windows下使用8pt字体的效果. 图3: Firefox用8pt英文字体效果 图4: Firefox用8pt中文字体效果 从上图可以看出, Firefox使用8pt英文字体已经和IE界面效果类似, 但是中文8pt字体就是一团浆糊了. 为了让8pt字体也能好看, 可以安装我推荐的一款simsun字体. 图5是安装了新字体之后的效果: 图5: Firefox用8pt新中文点阵字体效果]]></description>
			<content:encoded><![CDATA[<p>在Windows平台上用Firefox代替IE的最大困惑是, 觉得Firefox界面字体没有IE好看. 主要是因为Firefox默认使用Tahoma的9pt字体, 而IE沿用了Windows系统默认的8pt Tahoma字体. 如图1和图2所示:</p>
<p><strong>图1: Firefox界面默认字体</strong></p>
<p><a rel="lightbox" href="http://dipplum.com/files/2008/09/firefox1.png"><img class="alignnone size-full wp-image-40" title="firefox默认字体效果" src="http://dipplum.com/files/2008/09/firefox1.png" alt="" width="500" height="367" /></a></p>
<p><strong>图2: IE界面默认字体</strong></p>
<p><a rel="lightbox" href="http://dipplum.com/files/2008/09/ie.png"><img class="alignnone size-full wp-image-44" title="IE界面字体效果" src="http://dipplum.com/files/2008/09/ie.png" alt="" width="500" height="366" /></a></p>
<p>我们可以通过Firefox支持的css界面定制, 让Firefox也用8pt字体. 如果是Windows, 就在C:\Documents and Settings\username\Application Data\Mozilla\Firefox\Profiles\xxxxxx.default\chrome目录下(其中username是Windows帐号名, xxxxxx是若干随机生成的字母数字组合), 创建一个userChrome.css文件, 内容如下:</p>
<p><code>* {<br />
font-size: 8pt !important;<br />
font-family: tahoma, simsun !important<br />
}<br />
</code></p>
<p>下面图3和图4是Firefox在Windows下使用8pt字体的效果.</p>
<p><strong>图3: Firefox用8pt英文字体效果</strong></p>
<p><a rel="lightbox" href="http://dipplum.com/files/2008/09/firefox2.png"><img class="alignnone size-full wp-image-41" title="firefox用8pt英文字体效果" src="http://dipplum.com/files/2008/09/firefox2.png" alt="" width="500" height="366" /></a></p>
<p><strong>图4: Firefox用8pt中文字体效果</strong></p>
<p><a rel="lightbox" href="http://dipplum.com/files/2008/09/firefox3.png"><img class="alignnone size-full wp-image-42" title="firefox用8pt中文字体效果" src="http://dipplum.com/files/2008/09/firefox3.png" alt="" width="500" height="367" /></a></p>
<p>从上图可以看出, Firefox使用8pt英文字体已经和IE界面效果类似, 但是中文8pt字体就是一团浆糊了. 为了让8pt字体也能好看, 可以安装我推荐的<a href="http://dipplum.com/2008/09/03/recommended-simsun/">一款simsun字体</a>. 图5是安装了新字体之后的效果:</p>
<p><strong>图5: Firefox用8pt新中文点阵字体效果</strong></p>
<p><a rel="lightbox" href="http://dipplum.com/files/2008/09/firefox4.png"><img class="alignnone size-full wp-image-43" title="firefox用8pt新中文点阵字体" src="http://dipplum.com/files/2008/09/firefox4.png" alt="" width="500" height="367" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://dipplum.com/2008/09/04/firefox-fonts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>推荐一个simsun字体</title>
		<link>http://dipplum.com/2008/09/03/recommended-simsun/</link>
		<comments>http://dipplum.com/2008/09/03/recommended-simsun/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 09:43:22 +0000</pubDate>
		<dc:creator>li</dc:creator>
				<category><![CDATA[中文化]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[simsun]]></category>

		<guid isPermaLink="false">http://dipplum.com/?p=15</guid>
		<description><![CDATA[大家都知道在小字号下, 汉字字体使用点阵字模会比矢量字模要好看. Windows系统默认使用的字体是Tahoma和Simsun配合, 但是字号不一样, Tahoma是8pt(11px), Simsun是9pt(12px), 而且Simsun在8pt(11px)以下全都不是点阵字体, 非常难看. 由于不是所有Winows程序都可以沿用这种诡异的字号搭配, 所以某些程序显示的字体会很难看, 要么Tahoma和Simsun都用9pt字体, 这样Tahoma字体显得太大; 要么都用8pt, 这样中文字体就是一陀浆糊. 其中一种解决方案是使用更全面的simsun字体. 这个字体是fromnuaa在北大中文论文发布的, 一共有两种, 一种包含从6pt(8px)到16pt(21px)的宋体点阵字模, 一种包含6pt到21pt(28px)的. 安装方法: 首先在帖子里找到下载链接, 下载两个压缩包后, 解压生成SIMSUN.TTC, 然后下载下面的SIMSUN.inf. 将两个文件放到一个目录下, 右键inf文件, 选择&#8221;安装/Install&#8221;, 重启系统即可. 原simsun效果图 (点开以后用放大镜放大到原始尺寸, 才能看出点阵字库的效果) 新simsun效果图 下面是包含有上述文字的word 2007的文件下载, 可以用作测试用途]]></description>
			<content:encoded><![CDATA[<p>大家都知道在小字号下, 汉字字体使用点阵字模会比矢量字模要好看. Windows系统默认使用的字体是Tahoma和Simsun配合, 但是字号不一样, Tahoma是8pt(11px), Simsun是9pt(12px),  而且Simsun在8pt(11px)以下全都不是点阵字体, 非常难看.</p>
<p>由于不是所有Winows程序都可以沿用这种诡异的字号搭配, 所以某些程序显示的字体会很难看, 要么Tahoma和Simsun都用9pt字体, 这样Tahoma字体显得太大; 要么都用8pt, 这样中文字体就是一陀浆糊.</p>
<p>其中一种解决方案是使用更全面的simsun字体. 这个字体是fromnuaa在<a href="http://www.pkucn.com/viewthread.php?tid=205069&amp;extra=page%3D1">北大中文论文发布</a>的, 一共有两种, 一种包含从6pt(8px)到16pt(21px)的宋体点阵字模, 一种包含6pt到21pt(28px)的.</p>
<p><strong>安装方法:</strong> 首先在帖子里找到下载链接, 下载两个压缩包后, 解压生成SIMSUN.TTC, 然后下载下面的SIMSUN.inf. 将两个文件放到一个目录下, 右键inf文件, 选择&#8221;安装/Install&#8221;, 重启系统即可.<br />
Note: There is a file embedded within this post, please visit this post to download the file.</p>
<p><strong>原simsun效果图</strong> (点开以后用放大镜放大到原始尺寸, 才能看出点阵字库的效果)</p>
<p><a rel="lightbox" href="http://dipplum.com/files/2008/09/simsun2.png"><img class="alignnone size-thumbnail wp-image-17" title="原simsun效果" src="http://dipplum.com/files/2008/09/simsun2-150x150.png" alt="" width="150" height="150" /></a></p>
<p><strong>新simsun效果图</strong></p>
<p><a rel="lightbox" href="http://dipplum.com/files/2008/09/simsun1.png"><img class="alignnone size-thumbnail wp-image-16" title="新simsun效果图" src="http://dipplum.com/files/2008/09/simsun1-150x150.png" alt="" width="150" height="150" /></a></p>
<p>下面是包含有上述文字的word 2007的文件下载, 可以用作测试用途</p>
Note: There is a file embedded within this post, please visit this post to download the file.
]]></content:encoded>
			<wfw:commentRss>http://dipplum.com/2008/09/03/recommended-simsun/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

