OLD | NEW |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // Unicode table generator. | 5 // Unicode table generator. |
6 // Data read from the web. | 6 // Data read from the web. |
7 | 7 |
8 package main | 8 package main |
9 | 9 |
10 import ( | 10 import ( |
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 if len(orb) == 2 && chars[orb[0]].upperCase == orb[1] && chars[o
rb[1]].lowerCase == orb[0] { | 1035 if len(orb) == 2 && chars[orb[0]].upperCase == orb[1] && chars[o
rb[1]].lowerCase == orb[0] { |
1036 caseOrbit[i] = nil | 1036 caseOrbit[i] = nil |
1037 } | 1037 } |
1038 } | 1038 } |
1039 | 1039 |
1040 // Record orbit information in chars. | 1040 // Record orbit information in chars. |
1041 for _, orb := range caseOrbit { | 1041 for _, orb := range caseOrbit { |
1042 if orb == nil { | 1042 if orb == nil { |
1043 continue | 1043 continue |
1044 } | 1044 } |
1045 » » sort.SortInts(orb) | 1045 » » sort.Ints(orb) |
1046 c := orb[len(orb)-1] | 1046 c := orb[len(orb)-1] |
1047 for _, d := range orb { | 1047 for _, d := range orb { |
1048 chars[c].caseOrbit = d | 1048 chars[c].caseOrbit = d |
1049 c = d | 1049 c = d |
1050 } | 1050 } |
1051 } | 1051 } |
1052 | 1052 |
1053 printCaseOrbit() | 1053 printCaseOrbit() |
1054 | 1054 |
1055 // Tables of category and script folding exceptions: code points | 1055 // Tables of category and script folding exceptions: code points |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 return | 1242 return |
1243 } | 1243 } |
1244 fmt.Println() | 1244 fmt.Println() |
1245 fmt.Printf("// Range entries: %d 16-bit, %d 32-bit, %d total.\n", range1
6Count, range32Count, range16Count+range32Count) | 1245 fmt.Printf("// Range entries: %d 16-bit, %d 32-bit, %d total.\n", range1
6Count, range32Count, range16Count+range32Count) |
1246 range16Bytes := range16Count * 3 * 2 | 1246 range16Bytes := range16Count * 3 * 2 |
1247 range32Bytes := range32Count * 3 * 4 | 1247 range32Bytes := range32Count * 3 * 4 |
1248 fmt.Printf("// Range bytes: %d 16-bit, %d 32-bit, %d total.\n", range16B
ytes, range32Bytes, range16Bytes+range32Bytes) | 1248 fmt.Printf("// Range bytes: %d 16-bit, %d 32-bit, %d total.\n", range16B
ytes, range32Bytes, range16Bytes+range32Bytes) |
1249 fmt.Println() | 1249 fmt.Println() |
1250 fmt.Printf("// Fold orbit bytes: %d pairs, %d bytes\n", foldPairCount, f
oldPairCount*2*2) | 1250 fmt.Printf("// Fold orbit bytes: %d pairs, %d bytes\n", foldPairCount, f
oldPairCount*2*2) |
1251 } | 1251 } |
OLD | NEW |