Author: atsushi
Date: 2005-07-07 04:32:50 -0400 (Thu, 07 Jul 2005)
New Revision: 47028
Modified:
trunk/mcs/class/corlib/Mono.Globalization.Unicode/ChangeLog
trunk/mcs/class/corlib/Mono.Globalization.Unicode/MSCompatUnicodeTable.cs
trunk/mcs/class/corlib/Mono.Globalization.Unicode/create-mscompat-collation-table.cs
Log:
2005-07-06 Atsushi Enomoto <[EMAIL PROTECTED]>
* create-mscompat-collation-table.cs : improving Latin mappings.
Setting non-ASCII Latin characters' primary weight between those
ASCII characters, and setting diacritical weight (hacky).
* MSCompatUnicodeTable.cs :
Kanatype check: fixed (voice marks) and improved (comparison order).
Modified: trunk/mcs/class/corlib/Mono.Globalization.Unicode/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Mono.Globalization.Unicode/ChangeLog 2005-07-07
08:03:59 UTC (rev 47027)
+++ trunk/mcs/class/corlib/Mono.Globalization.Unicode/ChangeLog 2005-07-07
08:32:50 UTC (rev 47028)
@@ -1,5 +1,13 @@
2005-07-06 Atsushi Enomoto <[EMAIL PROTECTED]>
+ * create-mscompat-collation-table.cs : improving Latin mappings.
+ Setting non-ASCII Latin characters' primary weight between those
+ ASCII characters, and setting diacritical weight (hacky).
+ * MSCompatUnicodeTable.cs :
+ Kanatype check: fixed (voice marks) and improved (comparison order).
+
+2005-07-06 Atsushi Enomoto <[EMAIL PROTECTED]>
+
* create-mscompat-collation-table.cs : more diacritical fixes.
primary weight fixes on punctuations in category 07.
Modified:
trunk/mcs/class/corlib/Mono.Globalization.Unicode/MSCompatUnicodeTable.cs
===================================================================
--- trunk/mcs/class/corlib/Mono.Globalization.Unicode/MSCompatUnicodeTable.cs
2005-07-07 08:03:59 UTC (rev 47027)
+++ trunk/mcs/class/corlib/Mono.Globalization.Unicode/MSCompatUnicodeTable.cs
2005-07-07 08:32:50 UTC (rev 47028)
@@ -130,16 +130,20 @@
{
if (c < '\u3041')
return false;
+ else if ('\uFF66' <= c && c < '\uFF9E')
+ return true;
+ else if ('\u3300' <= c)
+ return false;
+ else if (c < '\u3099')
+ return true;
+ else if (c < '\u309D')
+ return false;
else if (c < '\u3100')
return true;
else if (c < '\u32D0')
return false;
else if (c < '\u32FF')
return true;
- else if (c < '\uFF66')
- return false;
- else if (c < '\uFF9F')
- return true;
return false;
}
Modified:
trunk/mcs/class/corlib/Mono.Globalization.Unicode/create-mscompat-collation-table.cs
===================================================================
---
trunk/mcs/class/corlib/Mono.Globalization.Unicode/create-mscompat-collation-table.cs
2005-07-07 08:03:59 UTC (rev 47027)
+++
trunk/mcs/class/corlib/Mono.Globalization.Unicode/create-mscompat-collation-table.cs
2005-07-07 08:32:50 UTC (rev 47028)
@@ -104,7 +104,8 @@
"WITH OGONEK;", "WITH CEDILLA;",
//
" DOUBLE ACUTE;", " ACUTE AND DOT ABOVE;",
- " STROKE;", " CIRCUMFLEX AND ACUTE;",
+ "WITH STROKE;", " CIRCUMFLEX AND ACUTE;",
+ "STROKE OVERLAY",
" DIAERESIS AND ACUTE;", "WITH CIRCUMFLEX AND GRAVE;",
" L SLASH;",
" DIAERESIS AND GRAVE;",
" BREVE AND ACUTE;",
@@ -156,7 +157,7 @@
0xE, 0xF, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
0x17, 0x19, 0x1A, 0x1B, 0x1C,
//
- 0x1D, 0x1D, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F,
+ 0x1D, 0x1D, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F,
0x20, 0x21, 0x22, 0x22, 0x23, 0x24,
//
0x25, 0x25, 0x25, 0x26, 0x28, 0x28, 0x28,
@@ -771,7 +772,10 @@
this.decompValues = (int [])
decompValues.ToArray (typeof (int));
}
-
+
+ char previousLatinTarget = char.MinValue;
+ byte [] diacriticalOffset = new byte ['Z' - 'A' + 1];
+
void ProcessUnidataLine (string s, ArrayList decompValues)
{
int idx = s.IndexOf ('#');
@@ -810,6 +814,14 @@
offset = lidx + 14;
}
if (lidx < 0) {
+ lidx = s.IndexOf ("LETTER CAPITAL ");
+ offset = lidx + 15;
+ }
+ if (lidx < 0) {
+ lidx = s.IndexOf ("LETTER SCRIPT ");
+ offset = lidx + 14;
+ }
+ if (lidx < 0) {
lidx = s.IndexOf ("LETTER ");
offset = lidx + 7;
}
@@ -817,15 +829,34 @@
char n = s [offset + 1];
char target = char.MinValue;
if ('A' <= c && c <= 'Z' &&
- (n == ' ') || n == ';')
+ (n == ' ') || n == ';') {
target = c;
- // FIXME: they are still not working fine.
- if (s.Substring (offset).StartsWith ("OI;")) //
01A2,01A3
- target = 'O';
+ // FIXME: After 'Z', I cannot reset
this state.
+ previousLatinTarget = c == 'Z' ?
char.MinValue : c;
+ }
+
if (s.Substring (offset).StartsWith ("ALPHA"))
target = 'A';
- if (s.Substring (offset).StartsWith ("SCHWA"))
+ else if (s.Substring (offset).StartsWith ("TONE
SIX"))
+ target = 'B';
+ else if (s.Substring (offset).StartsWith ("OPEN
O"))
+ target = 'C';
+ else if (s.Substring (offset).StartsWith
("SCHWA"))
target = 'E';
+ else if (s.Substring (offset).StartsWith
("ENG"))
+ target = 'N';
+ else if (s.Substring (offset).StartsWith
("OI;")) // 01A2,01A3
+ target = 'O';
+ else if (s.Substring (offset).StartsWith
("YR;")) // 01A2,01A3
+ target = 'R';
+ else if (s.Substring (offset).StartsWith ("TONE
TWO"))
+ target = 'S';
+ else if (s.Substring (offset).StartsWith
("ESH"))
+ target = 'S';
+
+ if (target == char.MinValue)
+ target = previousLatinTarget;
+
if (target != char.MinValue) {
ArrayList entry = (ArrayList) latinMap
[target];
if (entry == null) {
@@ -833,6 +864,14 @@
latinMap [target] = entry;
}
entry.Add (cp);
+ // FIXME: This secondary weight is hack.
+ // They are here because they must not
+ // be identical to the corresponding
+ // ASCII latins.
+ if (c != target && diacritical [cp] ==
0) {
+ diacriticalOffset [c - 'A']++;
+ diacritical [cp] = (byte)
(diacriticalOffset [c - 'A'] + 0x7C);
+ }
}
}
@@ -957,7 +996,9 @@
throw new Exception (String.Format ("Should not happen. weights are {0} while
labels are {1}", diacriticWeights.Length, diacritics.Length));
for (int d = 0; d < diacritics.Length; d++) {
if (s.IndexOf (diacritics [d]) > 0) {
- diacritical [cp] |= diacriticWeights
[d];
+ diacritical [cp] += diacriticWeights
[d];
+ if (s.IndexOf ("COMBINING") >= 0)
+ diacritical [cp] -= (byte) 2;
continue;
}
// also process "COMBINING blah" here
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches