2022-01-30 22:00:16 +01:00
|
|
|
package love.distributedrebirth.numberxd;
|
2022-01-28 11:24:54 +01:00
|
|
|
|
2022-01-29 12:39:43 +01:00
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
2022-11-05 13:41:48 +01:00
|
|
|
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
2022-08-23 09:28:19 +02:00
|
|
|
|
2022-10-30 16:59:24 +01:00
|
|
|
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
2022-01-31 19:06:09 +01:00
|
|
|
public enum Gê̄ldGetậlÅtHebrewVowel {
|
2022-01-28 11:24:54 +01:00
|
|
|
NONE (0, (char) 0x0000),
|
|
|
|
|
VOWEL_1 (1, (char) 0x05B4),
|
|
|
|
|
VOWEL_2 (2, (char) 0x05B5),
|
|
|
|
|
VOWEL_3 (3, (char) 0x05B6),
|
2022-02-09 16:39:11 +01:00
|
|
|
|
2022-01-28 11:24:54 +01:00
|
|
|
VOWEL_4 (4, (char) 0x05B2),
|
|
|
|
|
VOWEL_5 (5, (char) 0x05C7),
|
|
|
|
|
VOWEL_6 (6, (char) 0x05B7), // 06 = PATAH
|
|
|
|
|
VOWEL_7 (7, (char) 0x05A1),
|
2022-02-09 16:39:11 +01:00
|
|
|
|
2022-01-28 11:24:54 +01:00
|
|
|
VOWEL_8 (8, (char) 0x05A2),
|
|
|
|
|
VOWEL_9 (9, (char) 0x05A3),
|
|
|
|
|
VOWEL_10 (10, (char) 0x05B9), // 10 = POINT HOLAM
|
|
|
|
|
VOWEL_16 (16, (char) 0x05B8), // 16 = QAMATS
|
2022-02-09 16:39:11 +01:00
|
|
|
|
2022-01-28 11:24:54 +01:00
|
|
|
VOWEL_22 (22, (char) 0x0598),
|
|
|
|
|
VOWEL_30 (30, (char) 0x05BB), // 30 = QUBUTS
|
|
|
|
|
VOWEL_36 (36, (char) 0x05B3), // 36 = HATAF QAMATS
|
|
|
|
|
VOWEL_42 (42, (char) 0x05B1), // 50 = HATEF SEGOL
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
public static final byte BITMASK = 0b00001111;
|
|
|
|
|
private final int fractionOffset;
|
|
|
|
|
private final char character;
|
|
|
|
|
|
2022-01-31 19:06:09 +01:00
|
|
|
private static final Map<Character, Gê̄ldGetậlÅtHebrewVowel> CHAR_MAP = Collections.unmodifiableMap(
|
2022-01-29 12:39:43 +01:00
|
|
|
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getCharacter(), v -> v)));
|
|
|
|
|
|
2022-01-31 19:06:09 +01:00
|
|
|
private Gê̄ldGetậlÅtHebrewVowel(int fractionOffset, char character) {
|
2022-01-28 11:24:54 +01:00
|
|
|
this.fractionOffset = fractionOffset;
|
|
|
|
|
this.character = character;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getFractionOffset() {
|
|
|
|
|
return fractionOffset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public char getCharacter() {
|
|
|
|
|
return character;
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-31 19:06:09 +01:00
|
|
|
public static Gê̄ldGetậlÅtHebrewVowel indexOf(int index) {
|
2022-01-28 11:24:54 +01:00
|
|
|
return values()[index & BITMASK];
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-31 19:06:09 +01:00
|
|
|
public static Gê̄ldGetậlÅtHebrewVowel valueOfCharacter(char codePoint) {
|
2022-10-10 18:04:27 +02:00
|
|
|
// TODO add & move complete alias map
|
|
|
|
|
if (codePoint == 0x591 || codePoint == 0x596 || codePoint == 0x597 || codePoint == 0x59a || codePoint == 0x59c) {
|
|
|
|
|
return VOWEL_1;
|
|
|
|
|
}
|
|
|
|
|
if (codePoint == 0x5a5 || codePoint == 0x5a8 || codePoint == 0x5ab || codePoint == 0x5ac) {
|
|
|
|
|
return VOWEL_1;
|
|
|
|
|
}
|
|
|
|
|
if (codePoint == 0x5ba || codePoint == 0x5bc || codePoint == 0x5bd) {
|
|
|
|
|
return VOWEL_1;
|
|
|
|
|
}
|
|
|
|
|
if (codePoint == 0x5c1 || codePoint == 0x5c2) {
|
|
|
|
|
return VOWEL_1;
|
|
|
|
|
}
|
|
|
|
|
if (codePoint == 0x5b0) {
|
|
|
|
|
return VOWEL_2;
|
|
|
|
|
}
|
|
|
|
|
if (codePoint == 0x592 || codePoint == 0x5bb) {
|
|
|
|
|
return VOWEL_3;
|
|
|
|
|
}
|
2022-01-31 19:06:09 +01:00
|
|
|
return CHAR_MAP.getOrDefault(codePoint, Gê̄ldGetậlÅtHebrewVowel.NONE);
|
2022-01-28 11:24:54 +01:00
|
|
|
}
|
|
|
|
|
}
|