20120707初稿,20120708补充,20120714再次修订。
这个问题不难回答,但是我现在还回答不出来,因为没有足够大的语料库。
我把藏文字定义为一个纵向叠加单位,不管有多少层。有人称之为字丁,我嫌罗嗦,还是用字(字符)。
据卢老师说,现代藏文字的个数约360个。当然,我们现在需要处理的藏文还包括佛经里的古典藏文。
从一个小的分词语料库(4M)中统计出藏文字的个数是481个,字的总数962954个。
从一个大点的语料库(95M,也是来自卢老师,以下简称卢老师库)中统计出藏文字个数是1703个,字的总数33080574个。
从卢老师给的大藏经语料库(100M,以下简称卢老师大藏经库)中统计出藏文字个数是1214个,字的总数38172758个。
从我搜集转换的大藏经语料库中统计出藏文字个数是1728个,字的总数87911349个。
合并了卢老师库、卢老师大藏经库、青海新闻网、西藏新闻网的数据形成了一个稍大的语料库,共统计得到藏文字符总数是84596287个,其中不同的字是2342个。
合并了卢老师库、卢老师大藏经库、我的大藏经库、青海新闻网、西藏新闻网、一本词典、一个藏汉双语语料库的数据形成了一个更大的语料库,共统计得到藏文字符总数是178633697个,其中不同的字是2794个。
我们在上面计算的是用藏文的Unicode编码(也称为藏文编码字符集基本集)表示的不同藏文字的个数。藏文编码字符集基本集编码范围:U+0F00 到 U+0FD4。复杂的藏文字通过纵向叠加组合而得。一个藏文字对应一串变长的编码。基本集已足够表示所有藏文字。
说到了藏文编码,我们不得不提到除了基本集以外的藏文其他编码:
藏文编码字符集 扩充集A共有字符1536个,主要根据上述卢老师库的统计而定(卢老师说是张轴材从其统计的数据中减去了若干字)。编码在Unicode 0平面的私用区(PUA),编码范围:U+F300 到 U+F8FF。
藏文编码字符集 扩充集B共有字符5702个,编码在Unicode 平面A的辅助私用区(Supplementary Private Use Area-A in Plane 15)。编码范围:U+F0000 到 U+F1645。
注意,扩充集中一个码点对应于一个字符,和汉字编码类似,因此也称为预组字(precomposed character)。扩充集A和扩充集B都是国家标准,并不是国际标准,但是因为利用了Unicode的私用区,与unicode并不冲突。
采用扩充集的主要优点是简化排版和字符计算。但是因为扩B不在0平面,需要采用16或32位编码。其中,16位编码(UTF-16)可表示U+10FFFF以下的编码(实际为2^16-2^11+2^20=1112064个字符),32位编码则可以表示更多。32位编码最简单,但是浪费很多空间。
虽然引入扩充集的初衷是简化处理,但是实际上一个软件既要能处理基本集,又要能处理扩充集,反而使得软件更加复杂。对于纯藏文处理而言,当然可以先把所有基本集的叠加字符先转化为扩充集来进行预处理从而简化后续计算,但是这样做有一个前提条件,就是扩充集必须能表示基本集能表示的所有字符。目前我的猜测肯定是不行,否则也不需要扩充集C(我听说这个标准还在报批)了。当然,藏文处理软件并不只是处理藏文,所以这种预处理实际上是行不通的(见下文)。
我在网上查找藏文基本集和扩充集的有关资料时,发现了一些有用的信息:
以下2个网址可找到Unicode的藏文编码部分文档:
https://sites.google.com/site/chrisfynn2/home/tibetanscriptfonts/standarization/tibetanscriptintheucs
http://www.thlib.org/tools/#wiki=/access/wiki/site/26a34146-33a6-48ce-001e-f16ce7908a6a/tibetan%20character%20encoding%20proposals.html
我注意到后一个网址的表格中有一行为:N1095, 1994-09-xx, Proposal for encoding Tibetan script on BMP, China (Nima)。这个Nima应该就是尼玛扎西教授,他很早就参与了藏文编码标准化的过程。卢老师介绍说,以前网上有文章曾称他为“藏文IT之父”。可惜N1095这篇文章我在网上找不到。
我又在网上找到了Andrew West的系列博客。其中不但谈到了藏文编码,还有汉字编码。他的有关藏文编码的一篇博文的地址是:http://www.babelstone.co.uk/Blog/2006/09/precomposed-tibetan-part-1-brdarten.html。在这篇博文里面,他说道:
“The problem is that the Chinese government had never really bought into the decomposed Tibetan model. As far back as January 1994, when the encoding model for Tibetan was still under discussion, China submitted a proposal (N964) to encode Tibetan stacks as individual precomposed characters rather than as a sequence of combining characters, but this model was rejected in favour of the combining model.”
N964我也找不到。他又说道:
“Then six years after Tibetan encoding had been finalised, in December 2002, the Chinese national body submitted a proposal to encode nearly a thousand so-called “BrdaRten” (བརྡ་རྟེན, pronounced daden) precomposed stacks in the BMP at (see N2558, revised the following year as N2621, and further elaborated in N2661).”
也就是说,他不但认为中国是反对基本集的(早在1994),而且中国关于扩充集A的早期提案是被Unicode组织驳回的。但是我从别处看到,基本集是以中国为主提出来的。
我感到很疑惑。因为基本集和扩充集是两种技术路线。如果基本集是以中国为主提出来的,那么再提出扩充集就是自己打自己的嘴巴了。扩充集并不能表示出所有可能的藏文编码(包括梵文转写)。而如果两者并存,那么是一个非常糟糕的局面。藏文字的同一性都无法保证。对软件开发者而言,必须在处理藏文前进行从扩充集到基本集的编码转换(肯定不能反过来转换,因为印度的文字编码和藏文基本集类似,软件既然要处理藏文,没有理由不处理印度的文字)。这对全世界的软件开发者而言,增加了不必要的负担(国外的藏文处理软件如果不改,那么就无法处理中国的采用扩充集的藏文文档)。
我给Andrew West的博客留言,向他请求有关早期的藏文编码提案文档。他说他也没有。下面是他对我问题的一些回答:
我问:Who first proposed the current UCS Tibetan script?
他答:
China and UK both made proposals in early 1994:
N 964 Proposal for encoding Tibetan script; China; 1994-01
N 986 Proposal for Tibetan Script in the BMP; Bruce Paterson, Peter Lofting, U.K.; 1994.03.24
The Chinese proposal was discussed at the April 1994 meeting of WG2 in Turkey, with the Chinese proposal presented by Prof. Nyima Trashi of Tibet University (see N1033 8.4.3).
It seems that China initially proposed a set of 705 precomposed characters for standard Tibetan, and combining characters only for use in writing Sanskrit in Tibetan.
China worked with the Unicode Consortium over the following year, by email and in person at Unicode Technical Committee meetings in the US, to agree a revised encoding for Tibetan that used combining characters rather than precomposed characters. At the Helsinki WG2 meeting in June 1995 the joint China-Unicode code chart for Tibetan was presented, and further technical discussion took place (see N1253 6.4.5).
The result of this meeting was to task China and Unicode to work together to produce the final draft of the amendment (see N1254 M28.5).
A group of experts from China, Ireland and the UK (Nyima Trashi, DaWar Tsering, Tsering Choergyal, Michael Everson, Hugh McGregor Ross, and Mao Yonggang) worked together, and subsequently produced a joint proposed disposition of comments on PDAM6 (N1378), which was presented by China at the Copenhagen WG2 meeting in June 1996 (see N1353 6.2). The China-Ireland-UK document was accepted, and Tibetan was included in Unicode 2.0 released in July 1996.
显然,他这个说法和前面提到的他的博文有明显的不同。我后来在网上找到了WG2的所有文档,但是 N964 和 N986都没有。
我问:If China supported the dynamic stack initially, why on earth did they change their mind many years later?
他答:I don’t know.
我问:It seems to me totally meaningless and absurd … for China to make any sense, it must have objected to the USC encoding scheme from the very beginning.
他答:It did not. The UCS encoding model was developed by experts from China, Ireland, UK and USA, and the final code charts for Tibetan were produced by the China national body.
我说:Someone must be lying.
他说:I think it is not right to say anyone has been lying.
从这些问答里面可以明显看出,中国在藏文的Unicode编码(基本集)中起了关键作用。虽然Andrew West在前面提到的他的博文里对中国有负面的看法,但是他也不能否定基本事实。因此当我做出以下的总结时,他并没有表示反对:
我说:
1. China initially proposed both the precomposed and combining approaches.
2. China worked with the other bodies actively to finally decided on the combining approach. China is the main driving force in the standardization of the Tibetan in Unicode.
基本集的问题到此基本明朗。尼玛扎西教授在西藏大学,而扩充集的提出单位主要也是西藏大学工学院(http://baike.baidu.com/view/2444578.htm)。一个单位前后提出两种相互矛盾的编码,这是非常耐人寻味的。
我做出了一个没有根据的猜测,Andrew West对此发表了评论:
我说:Is it possible that the publishing houses in China actually were behind the scenes and they are so powerful in the government and so mean in technology that they lobbied the government for such a mad move? (原文笔误写成了It is …)
他道:Yes, I think so.
我猜测方正可能鼓动藏大工学院提出了N2558,Andrew West表示赞同。
平心而论,我觉得藏文基本集的编码的提出者是非常有智慧的。当然标准出来后10多年,微软才在OpenType中实现了藏文字形。而中国有名的北大方正,实现藏文印刷时,还是采用汉字的一字一码技术,虽然方正在国内响当当,但是实际上在技术上和国际大公司差距很大。其实,从基本集实现字符的纵向叠加,并没有那么难。微软花10多年,也许是人家没看到这个市场。
注:促使写这篇博文的藏文字(汉字)统计工具下载地址:http://59.77.21.82/mysoft/ccount.exe 注意只支持Windows 命令行下使用。