1 /*
2 * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 /*
27 *******************************************************************************
28 * Copyright (C) 2009-2014, International Business Machines
29 * Corporation and others. All Rights Reserved.
30 *******************************************************************************
31 */
32 package sun.text.normalizer;
33
34 import java.io.IOException;
35 import java.nio.ByteBuffer;
36 import java.text.Normalizer;
37
38 // Original filename in ICU4J: Normalizer2Impl.java
39 public final class NormalizerImpl {
40 public static final class Hangul {
41 /* Korean Hangul and Jamo constants */
42 public static final int JAMO_L_BASE=0x1100; /* "lead" jamo */
43 public static final int JAMO_V_BASE=0x1161; /* "vowel" jamo */
44 public static final int JAMO_T_BASE=0x11a7; /* "trail" jamo */
45
46 public static final int HANGUL_BASE=0xac00;
47 public static final int HANGUL_END=0xd7a3;
48
49 public static final int JAMO_L_COUNT=19;
50 public static final int JAMO_V_COUNT=21;
51 public static final int JAMO_T_COUNT=28;
52
53 public static final int HANGUL_COUNT=JAMO_L_COUNT*JAMO_V_COUNT*JAMO_T_COUNT;
54 public static final int HANGUL_LIMIT=HANGUL_BASE+HANGUL_COUNT;
55
56 public static boolean isHangul(int c) {
|
1 /*
2 * Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 /*
27 *******************************************************************************
28 * Copyright (C) 2009-2014, International Business Machines
29 * Corporation and others. All Rights Reserved.
30 *******************************************************************************
31 */
32 package jdk.internal.icu.impl;
33
34 import java.io.IOException;
35 import java.nio.ByteBuffer;
36
37 import jdk.internal.icu.lang.UCharacter;
38 import jdk.internal.icu.text.Normalizer2;
39 import jdk.internal.icu.text.UTF16;
40 import jdk.internal.icu.util.CodePointTrie;
41 import jdk.internal.icu.util.VersionInfo;
42
43 // Original filename in ICU4J: Normalizer2Impl.java
44 public final class NormalizerImpl {
45 public static final class Hangul {
46 /* Korean Hangul and Jamo constants */
47 public static final int JAMO_L_BASE=0x1100; /* "lead" jamo */
48 public static final int JAMO_V_BASE=0x1161; /* "vowel" jamo */
49 public static final int JAMO_T_BASE=0x11a7; /* "trail" jamo */
50
51 public static final int HANGUL_BASE=0xac00;
52 public static final int HANGUL_END=0xd7a3;
53
54 public static final int JAMO_L_COUNT=19;
55 public static final int JAMO_V_COUNT=21;
56 public static final int JAMO_T_COUNT=28;
57
58 public static final int HANGUL_COUNT=JAMO_L_COUNT*JAMO_V_COUNT*JAMO_T_COUNT;
59 public static final int HANGUL_LIMIT=HANGUL_BASE+HANGUL_COUNT;
60
61 public static boolean isHangul(int c) {
|