| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Tony Chang <idealisms@gmail.com> | 3 * Copyright (C) 2008 Tony Chang <idealisms@gmail.com> |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 smartSet = uset_openPattern( | 55 smartSet = uset_openPattern( |
| 56 kWhitespaceAndNewLine, | 56 kWhitespaceAndNewLine, |
| 57 lengthOfNullTerminatedString(kWhitespaceAndNewLine), &ec); | 57 lengthOfNullTerminatedString(kWhitespaceAndNewLine), &ec); |
| 58 DCHECK(U_SUCCESS(ec)) << ec; | 58 DCHECK(U_SUCCESS(ec)) << ec; |
| 59 | 59 |
| 60 // CJK ranges | 60 // CJK ranges |
| 61 uset_addRange(smartSet, 0x1100, | 61 uset_addRange(smartSet, 0x1100, |
| 62 0x1100 + 256); // Hangul Jamo (0x1100 - 0x11FF) | 62 0x1100 + 256); // Hangul Jamo (0x1100 - 0x11FF) |
| 63 uset_addRange(smartSet, 0x2E80, | 63 uset_addRange(smartSet, 0x2E80, |
| 64 0x2E80 + 352); // CJK & Kangxi Radicals (0x2E80 - 0x2FDF) | 64 0x2E80 + 352); // CJK & Kangxi Radicals (0x2E80 - 0x2FDF) |
| 65 uset_addRange( | 65 // Ideograph Descriptions, CJK Symbols, Hiragana, Katakana, Bopomofo, Hangul |
| 66 smartSet, 0x2FF0, | 66 // Compatibility Jamo, Kanbun, & Bopomofo Ext (0x2FF0 - 0x31BF) |
| 67 0x2FF0 + | 67 uset_addRange(smartSet, 0x2FF0, 0x2FF0 + 464); |
| 68 464); // Ideograph Descriptions, CJK Symbols, Hiragana, Katakana, B
opomofo, Hangul Compatibility Jamo, Kanbun, & Bopomofo Ext (0x2FF0 - 0x31BF) | 68 // Enclosed CJK, CJK Ideographs (Uni Han & Ext A), & Yi (0x3200 - 0xA4CF) |
| 69 uset_addRange( | 69 uset_addRange(smartSet, 0x3200, 0x3200 + 29392); |
| 70 smartSet, 0x3200, | |
| 71 0x3200 + | |
| 72 29392); // Enclosed CJK, CJK Ideographs (Uni Han & Ext A), & Yi (0x
3200 - 0xA4CF) | |
| 73 uset_addRange(smartSet, 0xAC00, | 70 uset_addRange(smartSet, 0xAC00, |
| 74 0xAC00 + 11183); // Hangul Syllables (0xAC00 - 0xD7AF) | 71 0xAC00 + 11183); // Hangul Syllables (0xAC00 - 0xD7AF) |
| 75 uset_addRange( | 72 uset_addRange( |
| 76 smartSet, 0xF900, | 73 smartSet, 0xF900, |
| 77 0xF900 + 352); // CJK Compatibility Ideographs (0xF900 - 0xFA5F) | 74 0xF900 + 352); // CJK Compatibility Ideographs (0xF900 - 0xFA5F) |
| 78 uset_addRange(smartSet, 0xFE30, | 75 uset_addRange(smartSet, 0xFE30, |
| 79 0xFE30 + 32); // CJK Compatibility From (0xFE30 - 0xFE4F) | 76 0xFE30 + 32); // CJK Compatibility From (0xFE30 - 0xFE4F) |
| 80 uset_addRange(smartSet, 0xFF00, | 77 uset_addRange(smartSet, 0xFF00, |
| 81 0xFF00 + 240); // Half/Full Width Form (0xFF00 - 0xFFEF) | 78 0xFF00 + 240); // Half/Full Width Form (0xFF00 - 0xFFEF) |
| 82 uset_addRange(smartSet, 0x20000, | 79 uset_addRange(smartSet, 0x20000, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 107 } | 104 } |
| 108 return smartSet; | 105 return smartSet; |
| 109 } | 106 } |
| 110 | 107 |
| 111 bool isCharacterSmartReplaceExempt(UChar32 c, bool isPreviousCharacter) { | 108 bool isCharacterSmartReplaceExempt(UChar32 c, bool isPreviousCharacter) { |
| 112 return uset_contains(getSmartSet(isPreviousCharacter), c); | 109 return uset_contains(getSmartSet(isPreviousCharacter), c); |
| 113 } | 110 } |
| 114 } | 111 } |
| 115 | 112 |
| 116 #endif // !OS(MACOSX) | 113 #endif // !OS(MACOSX) |
| OLD | NEW |