LEFT | RIGHT |
1 /* ------------------------------------------------------------------------ | 1 /* ------------------------------------------------------------------------ |
2 | 2 |
3 unicodedata -- Provides access to the Unicode database. | 3 unicodedata -- Provides access to the Unicode database. |
4 | 4 |
5 Data was extracted from the UnicodeData.txt file. | 5 Data was extracted from the UnicodeData.txt file. |
6 The current version number is reported in the unidata_version constant. | 6 The current version number is reported in the unidata_version constant. |
7 | 7 |
8 Written by Marc-Andre Lemburg (mal@lemburg.com). | 8 Written by Marc-Andre Lemburg (mal@lemburg.com). |
9 Modified for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com) | 9 Modified for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com) |
10 Modified by Martin v. Löwis (martin@v.loewis.de) | 10 Modified by Martin v. Löwis (martin@v.loewis.de) |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 i++; | 674 i++; |
675 goto again; /* continue while */ | 675 goto again; /* continue while */ |
676 } | 676 } |
677 } | 677 } |
678 /* Hangul Composition. We don't need to check for <LV,T> | 678 /* Hangul Composition. We don't need to check for <LV,T> |
679 pairs, since we always have decomposed data. */ | 679 pairs, since we always have decomposed data. */ |
680 code = PyUnicode_READ(kind, data, i); | 680 code = PyUnicode_READ(kind, data, i); |
681 if (LBase <= code && code < (LBase+LCount) && | 681 if (LBase <= code && code < (LBase+LCount) && |
682 i + 1 < len && | 682 i + 1 < len && |
683 VBase <= PyUnicode_READ(kind, data, i+1) && | 683 VBase <= PyUnicode_READ(kind, data, i+1) && |
684 PyUnicode_READ(kind, data, i+1) < (VBase+VCount)) { | 684 PyUnicode_READ(kind, data, i+1) <= (VBase+VCount)) { |
685 int LIndex, VIndex; | 685 int LIndex, VIndex; |
686 LIndex = code - LBase; | 686 LIndex = code - LBase; |
687 VIndex = PyUnicode_READ(kind, data, i+1) - VBase; | 687 VIndex = PyUnicode_READ(kind, data, i+1) - VBase; |
688 code = SBase + (LIndex*VCount+VIndex)*TCount; | 688 code = SBase + (LIndex*VCount+VIndex)*TCount; |
689 i+=2; | 689 i+=2; |
690 if (i < len && | 690 if (i < len && |
691 TBase <= PyUnicode_READ(kind, data, i) && | 691 TBase < PyUnicode_READ(kind, data, i) && |
692 PyUnicode_READ(kind, data, i) <= (TBase+TCount)) { | 692 PyUnicode_READ(kind, data, i) < (TBase+TCount)) { |
693 code += PyUnicode_READ(kind, data, i)-TBase; | 693 code += PyUnicode_READ(kind, data, i)-TBase; |
694 i++; | 694 i++; |
695 } | 695 } |
696 output[o++] = code; | 696 output[o++] = code; |
697 continue; | 697 continue; |
698 } | 698 } |
699 | 699 |
700 /* code is still input[i] here */ | 700 /* code is still input[i] here */ |
701 f = find_nfc_index(self, nfc_first, code); | 701 f = find_nfc_index(self, nfc_first, code); |
702 if (f == -1) { | 702 if (f == -1) { |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 PyModule_AddObject(m, "ucnhash_CAPI", v); | 1363 PyModule_AddObject(m, "ucnhash_CAPI", v); |
1364 return m; | 1364 return m; |
1365 } | 1365 } |
1366 | 1366 |
1367 /* | 1367 /* |
1368 Local variables: | 1368 Local variables: |
1369 c-basic-offset: 4 | 1369 c-basic-offset: 4 |
1370 indent-tabs-mode: nil | 1370 indent-tabs-mode: nil |
1371 End: | 1371 End: |
1372 */ | 1372 */ |
LEFT | RIGHT |