home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / std / internat / 1314 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  6.0 KB

  1. Path: sparky!uunet!mcsun!sunic!corax.udac.uu.se!Riga.DoCS.UU.SE!andersa
  2. From: andersa@Riga.DoCS.UU.SE (Anders Andersson)
  3. Newsgroups: comp.std.internat
  4. Subject: Re: Radicals Instead of Characters
  5. Date: 24 Jan 1993 15:31:44 GMT
  6. Organization: Uppsala University, Sweden
  7. Lines: 111
  8. Distribution: world
  9. Message-ID: <1jucp0INN5pe@corax.udac.uu.se>
  10. References: <1jfgq1INNqmn@flop.ENGR.ORST.EDU> <2791@titccy.cc.titech.ac.jp> <1jpj9sINNlie@flop.ENGR.ORST.EDU> <1jtbfvINNqvr@life.ai.mit.edu>
  11. NNTP-Posting-Host: riga.docs.uu.se
  12.  
  13. In article <1jtbfvINNqvr@life.ai.mit.edu>, glenn@wheat-chex.ai.mit.edu (Glenn A. Adams) writes:
  14. > To summarize, a decomposed Han character approach may reduce the number of
  15. > code points needed from approximately 2^16 to approximately 2^11; however
  16. > text storage sizes will have a commensurate increase.  So, to roughly gauge
  17. > this, we might have:
  18. >   precomposed encoding
  19. >   2^20 precomposed characters *
  20. >   2^16 bits/precomposed character =
  21. >   2^36 bits
  22. >   decomposed encoding
  23. >   2^20 precomposed characters *
  24. >   2^4  decomposed characters/precomposed character *
  25. >   2^11 bits/decomposed character =
  26. >   2^35 bits
  27. > Thus a decomposed encoding may produce a 2 times space savings overall;
  28. > perhaps more still if the average decomposition is much smaller than 16
  29. > elements.  However, the cost of processing now increases dramatically
  30. > since indexing is no longer possible without parsing a string.  Furthermore,
  31. > nobody is going to use 11 bit character codes.  Once you go over 8 bits,
  32. > the only logical choice is 16 bits, or perhaps 32 bits.  Since 32 bits is
  33. > clearly overkill, there remains a 16-bit encoding model:  Unicode.
  34.  
  35. Didn't you skip one step in your otherwise excellent analysis here?
  36. The 20,000+ Han characters of Unicode today effectively employ 15 bits,
  37. leaving 50-75% of the code space for characters from other scripts.
  38. If the Han characters were only to use 11 bits, we surely wouldn't
  39. start processing text in 11- or 12-bit chunks where we now use 16.
  40. Instead, there would be more room within a 16-bit character set for
  41. yet other scripts, as the Han characters would need less than 4% of it.
  42. Is 16 bits enough for everything we'd like to encode, then?
  43.  
  44. Once we accept decomposition of characters into smaller elements,
  45. we are de facto introducing variable-length encoding of characters
  46. (as a character may consist of a variable number of elements).
  47. However, we need not allow for arbitrary combinations of elements
  48. from different scripts (I suppose a Japanese `grass' radical makes
  49. no sense with an Arabic `alef' letter), so a suitable number of bits
  50. could be picked for each set of related elements, and which set is
  51. meant could be determined from an initial (short) bit sequence.
  52.  
  53. For storage and transmission, we need a simple way to determine
  54. where each character starts and stops.  My suggestion for the
  55. environment biased towards 8 bits:  Divide the entire character
  56. bit sequence into 7-bit bytes (padding the last byte with 0's)
  57. and set the 8th bit of each byte except the last to "1".  Now
  58. we can easily determine where each character stops, without
  59. knowing the intrinsics of every script encoded.  Example:
  60.  
  61. 11001101 ;1=more,10=Han,011=element 3 of 8,01+110=e. 14 of 32,
  62. 11100110 ;1=more,110 consumed above,0110+10001=e. 209 of 512,
  63. 01000100 ;0=end,10001 consumed above,00=padding.
  64.  
  65. When reading this into a `character' data type for processing,
  66. you may store it as 11001101 11100110 01000100 00000000, or as
  67. 10011011 10011010 00100000, or even as 10 011 01110 011010001,
  68. depending on your particular processing and optimization needs.
  69.  
  70. The length of the actual bit sequences used to represent the
  71. different character elements should probably be optimized with
  72. respect to some average character frequency, in order not to
  73. unnecessarily alienate any particular portion of the market.
  74. For instance, we may be able to cram the most frequent Latin
  75. and Cyrillic letters (such as the lowercase ones) into the
  76. first octet, but not much else.  Compare with Morse code.
  77.  
  78. A difference between this method and UTF encoding (as I have
  79. understood it from examples posted to this forum) is that the
  80. length of the bit sequence used to represent a `character' is
  81. directly dependent on the length of the element codes, rather
  82. than on the position of the character in a fixed-width code
  83. table.  I haven't analyzed this in detail; maybe it can be
  84. shown that there exists a fixed-width encoding such that it
  85. equals or surpasses my variable-width element encoding in
  86. terms of storage compactness.
  87.  
  88. In any case, my aim is not to provide the most space-efficient
  89. encoding possible, but to minimize the need for table lookups
  90. for doing basic character identification and processing (such
  91. as case unification and font selection).  Of course, table
  92. lookups are fast, but using a table for converting "a" to
  93. "A" looks like overkill to me.  Part of this aim is to allow
  94. for (some) future extensions to the code without distributing
  95. new tables each time.  Am I misjudging the efforts required
  96. to implement the different solutions?
  97.  
  98. Please note that I'm not saying that this point of mine makes
  99. decomposed Han character encoding worthwhile; I'm simply not
  100. versed enough with Han characters to tell what it would mean
  101. in terms of storage and processing.  Maybe there are reasonable
  102. compromises between a full precomposed set, and a fully decomposed
  103. system based on radicals or whatever character component is found
  104. useful.
  105.  
  106. Han characters are not the only candidates for decomposition;
  107. I'd decompose Latin ligatures and letters with diacritical marks
  108. right away (assuming we are still talking about a potential
  109. character set, and not Unicode itself).  I don't see much reason
  110. for giving the superscript "TM" compound symbol a code of its
  111. own (other than the aforementioned backward compatibility goal),
  112. as we'll need a generic superscript mechanism anyway.  Same for
  113. the KSC (and GB?) measurement units and encircled numerals.
  114. Why stop at "(20)", really?  Maybe someone wants "(21)"?
  115. --
  116. Anders Andersson, Dept. of Computer Systems, Uppsala University
  117. Paper Mail: Box 325, S-751 05 UPPSALA, Sweden
  118. Phone: +46 18 183170   EMail: andersa@DoCS.UU.SE
  119.