1. /*
  2. * @(#)CollationRules.java 1.26 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. /*
  8. * (C) Copyright Taligent, Inc. 1996,1997 - All Rights Reserved
  9. * (C) Copyright IBM Corp. 1996, 1997 - All Rights Reserved
  10. *
  11. * The original version of this source code and documentation is copyrighted
  12. * and owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These
  13. * materials are provided under terms of a License Agreement between Taligent
  14. * and Sun. This technology is protected by multiple US and International
  15. * patents. This notice and attribution to Taligent may not be removed.
  16. * Taligent is a registered trademark of Taligent, Inc.
  17. *
  18. */
  19. package java.text;
  20. /**
  21. * CollationRules contains the default en_US collation rules as a base
  22. * for building other collation tables.
  23. * <p>Note that decompositions are done before these rules are used,
  24. * so they do not have to contain accented characters, such as A-grave.
  25. * @see RuleBasedCollator
  26. * @see LocaleElements
  27. * @version 1.26, 12/19/03
  28. * @author Helena Shih, Mark Davis
  29. */
  30. final class CollationRules {
  31. final static String DEFAULTRULES = new String(
  32. "" // no FRENCH accent order by default, add in French Delta
  33. // IGNORABLES (up to first < character)
  34. // COMPLETELY IGNORE format characters
  35. + "='\u200B'=\u200C=\u200D=\u200E=\u200F"
  36. // Control Characters
  37. + "=\u0000 =\u0001 =\u0002 =\u0003 =\u0004" //null, .. eot
  38. + "=\u0005 =\u0006 =\u0007 =\u0008 ='\u0009'" //enq, ...
  39. + "='\u000b' =\u000e" //vt,, so
  40. + "=\u000f ='\u0010' =\u0011 =\u0012 =\u0013" //si, dle, dc1, dc2, dc3
  41. + "=\u0014 =\u0015 =\u0016 =\u0017 =\u0018" //dc4, nak, syn, etb, can
  42. + "=\u0019 =\u001a =\u001b =\u001c =\u001d" //em, sub, esc, fs, gs
  43. + "=\u001e =\u001f =\u007f" //rs, us, del
  44. //....then the C1 Latin 1 reserved control codes
  45. + "=\u0080 =\u0081 =\u0082 =\u0083 =\u0084 =\u0085"
  46. + "=\u0086 =\u0087 =\u0088 =\u0089 =\u008a =\u008b"
  47. + "=\u008c =\u008d =\u008e =\u008f =\u0090 =\u0091"
  48. + "=\u0092 =\u0093 =\u0094 =\u0095 =\u0096 =\u0097"
  49. + "=\u0098 =\u0099 =\u009a =\u009b =\u009c =\u009d"
  50. + "=\u009e =\u009f"
  51. // IGNORE except for secondary, tertiary difference
  52. // Spaces
  53. + ";'\u0020';'\u00A0'" // spaces
  54. + ";'\u2000';'\u2001';'\u2002';'\u2003';'\u2004'" // spaces
  55. + ";'\u2005';'\u2006';'\u2007';'\u2008';'\u2009'" // spaces
  56. + ";'\u200A';'\u3000';'\uFEFF'" // spaces
  57. + ";'\r' ;'\t' ;'\n';'\f';'\u000b'" // whitespace
  58. // Non-spacing accents
  59. + ";\u0301" // non-spacing acute accent
  60. + ";\u0300" // non-spacing grave accent
  61. + ";\u0306" // non-spacing breve accent
  62. + ";\u0302" // non-spacing circumflex accent
  63. + ";\u030c" // non-spacing caron/hacek accent
  64. + ";\u030a" // non-spacing ring above accent
  65. + ";\u030d" // non-spacing vertical line above
  66. + ";\u0308" // non-spacing diaeresis accent
  67. + ";\u030b" // non-spacing double acute accent
  68. + ";\u0303" // non-spacing tilde accent
  69. + ";\u0307" // non-spacing dot above/overdot accent
  70. + ";\u0304" // non-spacing macron accent
  71. + ";\u0337" // non-spacing short slash overlay (overstruck diacritic)
  72. + ";\u0327" // non-spacing cedilla accent
  73. + ";\u0328" // non-spacing ogonek accent
  74. + ";\u0323" // non-spacing dot-below/underdot accent
  75. + ";\u0332" // non-spacing underscore/underline accent
  76. // with the rest of the general diacritical marks in binary order
  77. + ";\u0305" // non-spacing overscore/overline
  78. + ";\u0309" // non-spacing hook above
  79. + ";\u030e" // non-spacing double vertical line above
  80. + ";\u030f" // non-spacing double grave
  81. + ";\u0310" // non-spacing chandrabindu
  82. + ";\u0311" // non-spacing inverted breve
  83. + ";\u0312" // non-spacing turned comma above/cedilla above
  84. + ";\u0313" // non-spacing comma above
  85. + ";\u0314" // non-spacing reversed comma above
  86. + ";\u0315" // non-spacing comma above right
  87. + ";\u0316" // non-spacing grave below
  88. + ";\u0317" // non-spacing acute below
  89. + ";\u0318" // non-spacing left tack below
  90. + ";\u0319" // non-spacing tack below
  91. + ";\u031a" // non-spacing left angle above
  92. + ";\u031b" // non-spacing horn
  93. + ";\u031c" // non-spacing left half ring below
  94. + ";\u031d" // non-spacing up tack below
  95. + ";\u031e" // non-spacing down tack below
  96. + ";\u031f" // non-spacing plus sign below
  97. + ";\u0320" // non-spacing minus sign below
  98. + ";\u0321" // non-spacing palatalized hook below
  99. + ";\u0322" // non-spacing retroflex hook below
  100. + ";\u0324" // non-spacing double dot below
  101. + ";\u0325" // non-spacing ring below
  102. + ";\u0326" // non-spacing comma below
  103. + ";\u0329" // non-spacing vertical line below
  104. + ";\u032a" // non-spacing bridge below
  105. + ";\u032b" // non-spacing inverted double arch below
  106. + ";\u032c" // non-spacing hacek below
  107. + ";\u032d" // non-spacing circumflex below
  108. + ";\u032e" // non-spacing breve below
  109. + ";\u032f" // non-spacing inverted breve below
  110. + ";\u0330" // non-spacing tilde below
  111. + ";\u0331" // non-spacing macron below
  112. + ";\u0333" // non-spacing double underscore
  113. + ";\u0334" // non-spacing tilde overlay
  114. + ";\u0335" // non-spacing short bar overlay
  115. + ";\u0336" // non-spacing long bar overlay
  116. + ";\u0338" // non-spacing long slash overlay
  117. + ";\u0339" // non-spacing right half ring below
  118. + ";\u033a" // non-spacing inverted bridge below
  119. + ";\u033b" // non-spacing square below
  120. + ";\u033c" // non-spacing seagull below
  121. + ";\u033d" // non-spacing x above
  122. + ";\u033e" // non-spacing vertical tilde
  123. + ";\u033f" // non-spacing double overscore
  124. //+ ";\u0340" // non-spacing grave tone mark == \u0300
  125. //+ ";\u0341" // non-spacing acute tone mark == \u0301
  126. + ";\u0342;"
  127. //+ "\u0343;" // == \u0313
  128. + "\u0344;\u0345;\u0360;\u0361" // newer
  129. + ";\u0483;\u0484;\u0485;\u0486" // Cyrillic accents
  130. + ";\u20D0;\u20D1;\u20D2" // symbol accents
  131. + ";\u20D3;\u20D4;\u20D5" // symbol accents
  132. + ";\u20D6;\u20D7;\u20D8" // symbol accents
  133. + ";\u20D9;\u20DA;\u20DB" // symbol accents
  134. + ";\u20DC;\u20DD;\u20DE" // symbol accents
  135. + ";\u20DF;\u20E0;\u20E1" // symbol accents
  136. + ",'\u002D';\u00AD" // dashes
  137. + ";\u2010;\u2011;\u2012" // dashes
  138. + ";\u2013;\u2014;\u2015" // dashes
  139. + ";\u2212" // dashes
  140. // other punctuation
  141. + "<'\u005f'" // underline/underscore (spacing)
  142. + "<\u00af" // overline or macron (spacing)
  143. + "<'\u002c'" // comma (spacing)
  144. + "<'\u003b'" // semicolon
  145. + "<'\u003a'" // colon
  146. + "<'\u0021'" // exclamation point
  147. + "<\u00a1" // inverted exclamation point
  148. + "<'\u003f'" // question mark
  149. + "<\u00bf" // inverted question mark
  150. + "<'\u002f'" // slash
  151. + "<'\u002e'" // period/full stop
  152. + "<\u00b4" // acute accent (spacing)
  153. + "<'\u0060'" // grave accent (spacing)
  154. + "<'\u005e'" // circumflex accent (spacing)
  155. + "<\u00a8" // diaresis/umlaut accent (spacing)
  156. + "<'\u007e'" // tilde accent (spacing)
  157. + "<\u00b7" // middle dot (spacing)
  158. + "<\u00b8" // cedilla accent (spacing)
  159. + "<'\u0027'" // apostrophe
  160. + "<'\"'" // quotation marks
  161. + "<\u00ab" // left angle quotes
  162. + "<\u00bb" // right angle quotes
  163. + "<'\u0028'" // left parenthesis
  164. + "<'\u0029'" // right parenthesis
  165. + "<'\u005b'" // left bracket
  166. + "<'\u005d'" // right bracket
  167. + "<'\u007b'" // left brace
  168. + "<'\u007d'" // right brace
  169. + "<\u00a7" // section symbol
  170. + "<\u00b6" // paragraph symbol
  171. + "<\u00a9" // copyright symbol
  172. + "<\u00ae" // registered trademark symbol
  173. + "<'\u0040'" // at sign
  174. + "<\u00a4" // international currency symbol
  175. + "<\u0e3f" // baht sign
  176. + "<\u00a2" // cent sign
  177. + "<\u20a1" // colon sign
  178. + "<\u20a2" // cruzeiro sign
  179. + "<'\u0024'" // dollar sign
  180. + "<\u20ab" // dong sign
  181. + "<\u20ac" // euro sign
  182. + "<\u20a3" // franc sign
  183. + "<\u20a4" // lira sign
  184. + "<\u20a5" // mill sign
  185. + "<\u20a6" // naira sign
  186. + "<\u20a7" // peseta sign
  187. + "<\u00a3" // pound-sterling sign
  188. + "<\u20a8" // rupee sign
  189. + "<\u20aa" // new shekel sign
  190. + "<\u20a9" // won sign
  191. + "<\u00a5" // yen sign
  192. + "<'\u002a'" // asterisk
  193. + "<'\\'" // backslash
  194. + "<'\u0026'" // ampersand
  195. + "<'\u0023'" // number sign
  196. + "<'\u0025'" // percent sign
  197. + "<'\u002b'" // plus sign
  198. + "<\u00b1" // plus-or-minus sign
  199. + "<\u00f7" // divide sign
  200. + "<\u00d7" // multiply sign
  201. + "<'\u003c'" // less-than sign
  202. + "<'\u003d'" // equal sign
  203. + "<'\u003e'" // greater-than sign
  204. + "<\u00ac" // end of line symbol/logical NOT symbol
  205. + "<'\u007c'" // vertical line/logical OR symbol
  206. + "<\u00a6" // broken vertical line
  207. + "<\u00b0" // degree symbol
  208. + "<\u00b5" // micro symbol
  209. // NUMERICS
  210. + "<0<1<2<3<4<5<6<7<8<9"
  211. + "<\u00bc<\u00bd<\u00be" // 1/4,1/2,3/4 fractions
  212. // NON-IGNORABLES
  213. + "<a,A"
  214. + "<b,B"
  215. + "<c,C"
  216. + "<d,D"
  217. + "<\u00F0,\u00D0" // eth
  218. + "<e,E"
  219. + "<f,F"
  220. + "<g,G"
  221. + "<h,H"
  222. + "<i,I"
  223. + "<j,J"
  224. + "<k,K"
  225. + "<l,L"
  226. + "<m,M"
  227. + "<n,N"
  228. + "<o,O"
  229. + "<p,P"
  230. + "<q,Q"
  231. + "<r,R"
  232. + "<s, S & SS,\u00DF" // s-zet
  233. + "<t,T"
  234. + "& TH, \u00DE &TH, \u00FE " // thorn
  235. + "<u,U"
  236. + "<v,V"
  237. + "<w,W"
  238. + "<x,X"
  239. + "<y,Y"
  240. + "<z,Z"
  241. + "&AE,\u00C6" // ae & AE ligature
  242. + "&AE,\u00E6"
  243. + "&OE,\u0152" // oe & OE ligature
  244. + "&OE,\u0153"
  245. );
  246. }