gdxapp4d/gdxapp4d-lib-numberxd/src/main/java/love/distributedrebirth/numberxd/Gê̄ldGetậlÅtHebrewVowel.java

107 lines
4.1 KiB
Java
Raw Normal View History

2022-11-15 09:51:54 +00:00
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
2022-01-30 21:00:16 +00:00
package love.distributedrebirth.numberxd;
2022-01-28 10:24:54 +00:00
2022-01-29 11:39:43 +00:00
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import java.util.stream.Collectors;
2022-11-05 12:41:48 +00:00
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
2022-10-30 15:59:24 +00:00
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
2022-01-31 18:06:09 +00:00
public enum Gê̄ldGetậlÅtHebrewVowel {
2022-01-28 10:24:54 +00:00
NONE (0, (char) 0x0000),
VOWEL_1 (1, (char) 0x05B4),
VOWEL_2 (2, (char) 0x05B5),
VOWEL_3 (3, (char) 0x05B6),
2022-02-09 15:39:11 +00:00
2022-01-28 10:24:54 +00: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 15:39:11 +00:00
2022-01-28 10:24:54 +00: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 15:39:11 +00:00
2022-01-28 10:24:54 +00: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 18:06:09 +00:00
private static final Map<Character, Gê̄ldGetậlÅtHebrewVowel> CHAR_MAP = Collections.unmodifiableMap(
2022-01-29 11:39:43 +00:00
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getCharacter(), v -> v)));
2022-01-31 18:06:09 +00:00
private Gê̄ldGetậlÅtHebrewVowel(int fractionOffset, char character) {
2022-01-28 10:24:54 +00:00
this.fractionOffset = fractionOffset;
this.character = character;
}
public int getFractionOffset() {
return fractionOffset;
}
public char getCharacter() {
return character;
}
2022-01-31 18:06:09 +00:00
public static Gê̄ldGetậlÅtHebrewVowel indexOf(int index) {
2022-01-28 10:24:54 +00:00
return values()[index & BITMASK];
}
2022-01-31 18:06:09 +00:00
public static Gê̄ldGetậlÅtHebrewVowel valueOfCharacter(char codePoint) {
2022-10-10 16:04:27 +00: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 18:06:09 +00:00
return CHAR_MAP.getOrDefault(codePoint, Gê̄ldGetậlÅtHebrewVowel.NONE);
2022-01-28 10:24:54 +00:00
}
}