FC18: Corrected importer method naming regarding FC6 and FC18
This commit is contained in:
parent
b2e883c1b6
commit
fa6dc9ce2c
6 changed files with 39 additions and 44 deletions
|
|
@ -36,36 +36,36 @@ import org.x4o.fc18.zion7.octal8.PrimordialOctalOrangeString;
|
|||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
public final class WarpManifestX18Import {
|
||||
|
||||
|
||||
private WarpManifestX18Import() {
|
||||
}
|
||||
|
||||
|
||||
static public WarpManifestX18 fromX8(WarpManifestX8 manifest) {
|
||||
WarpManifestX18Section sectionX18 = null;
|
||||
WarpManifestX18HeaderField fieldX18 = null;
|
||||
WarpManifestX18 result = new WarpManifestX18();
|
||||
for (WarpManifestX8HeaderField attrX8 : manifest.getAttributes()) {
|
||||
fieldX18 = result.makeAttribute(toX8(attrX8.getName()), toX8(attrX8.getBody()));
|
||||
fieldX18 = result.makeAttribute(toFC8(attrX8.getName()), toFC8(attrX8.getBody()));
|
||||
for (String remark : attrX8.getRemarks()) {
|
||||
fieldX18.withRemark(toX8(remark));
|
||||
fieldX18.withRemark(toFC8(remark));
|
||||
}
|
||||
}
|
||||
for (WarpManifestX8Section sectionX8 : manifest.getSections()) {
|
||||
sectionX18 = result.makeSection(toX8(sectionX8.getName()));
|
||||
sectionX18 = result.makeSection(toFC8(sectionX8.getName()));
|
||||
for (String remark : sectionX8.getRemarks()) {
|
||||
sectionX18.withRemark(toX8(remark));
|
||||
sectionX18.withRemark(toFC8(remark));
|
||||
}
|
||||
for (WarpManifestX8HeaderField attrX8 : sectionX8.getAttributes()) {
|
||||
fieldX18 = sectionX18.makeAttribute(toX8(attrX8.getName()), toX8(attrX8.getBody()));
|
||||
fieldX18 = sectionX18.makeAttribute(toFC8(attrX8.getName()), toFC8(attrX8.getBody()));
|
||||
for (String remark : attrX8.getRemarks()) {
|
||||
fieldX18.withRemark(toX8(remark));
|
||||
fieldX18.withRemark(toFC8(remark));
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static private PrimordialOctalOrangeJuiceStraw toX8(String value) {
|
||||
return PrimordialOctalOrangeString.valueOfSmurfs(FourCornerUnicodeImport.lossy().convertToInt18(value));
|
||||
|
||||
static private PrimordialOctalOrangeJuiceStraw toFC8(String value) {
|
||||
return PrimordialOctalOrangeString.ioSmurfReadListX18(FourCornerUnicodeImport.lossy().convertToFC18(value));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,25 +86,20 @@ public class FourCornerUnicodeImport {
|
|||
return new FourCornerUnicodeImport(true, false, List.of(FCDotCDC1604DashP6.NS05_RAKA1_UPQUESTION)); // TODO: change
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public List<Integer> convertToInt18(String text) {
|
||||
return convertToX18(text, new ArrayList<>(text.length()));
|
||||
public List<Integer> convertToFC6(String text) {
|
||||
return convertToFC6(text, new ArrayList<>(text.length()));
|
||||
}
|
||||
|
||||
public List<Integer> convertToX06(String text) {
|
||||
return convertToX06(text, new ArrayList<>(text.length()));
|
||||
public List<Integer> convertToFC18(String text) {
|
||||
return convertToFC18(text, new ArrayList<>(text.length()));
|
||||
}
|
||||
|
||||
public List<Integer> convertToX18(String text) {
|
||||
return convertToX18(text, new ArrayList<>(text.length()));
|
||||
}
|
||||
|
||||
public List<Integer> convertToX06(String text, List<Integer> out) {
|
||||
public List<Integer> convertToFC6(String text, List<Integer> out) {
|
||||
convertToXXX(text, true, v -> out.add(v));
|
||||
return out;
|
||||
}
|
||||
|
||||
public List<Integer> convertToX18(String text, List<Integer> out) {
|
||||
public List<Integer> convertToFC18(String text, List<Integer> out) {
|
||||
convertToXXX(text, false, v -> out.add(v));
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -220,9 +220,9 @@ public enum FourCornerDotCake {
|
|||
// - no value owning numbers
|
||||
// - no colored symbols
|
||||
|
||||
FC_BMW0102_S2(1024 - 12, 2, "Binary Model Words, for bit 0 and bit 1 notation"),
|
||||
FC_BMW0102_S2(1024 - 12, 2, "Binary Model Words, for binary in 1 bit"),
|
||||
FC_AMD0110_SA(1024 - 10, 10, "Application Methodoums Decimals, normal numbers"),
|
||||
FC_IBM1616_H8(1024, 256, "Interim Byte Mode, custom HEX codes"),
|
||||
FC_IBM1616_H8(1024, 256, "Interim Byte Mode, custom HEX codes in 8 bit"),
|
||||
FC_NES0127_9C(1280, 27, "Nigerian Extra Smile, hebrew gematria"),
|
||||
FC_WDC0109_S9(1307, 9, "Wholly Direct Counts, real postive numbers"),
|
||||
FC_SCO0106_S6(1316, 6, "Six Character Object"),
|
||||
|
|
@ -230,7 +230,7 @@ public enum FourCornerDotCake {
|
|||
FC_NEC0105_S5(1325, 5, "New Endian Compass"),
|
||||
FC_W3C0107_S7(1330, 7, "Water 3th Color"),
|
||||
FC_UWU0101_S1(1337, 1, "Universal White Unidad, one slice for all space"),
|
||||
FC_DNA0104_S4(1338, 4, "Direct Nuclear Air strike, of quadratonic values"),
|
||||
FC_DNA0104_S4(1338, 4, "Direct Nuclear Air strike, of quadratonic values in 2 bit"),
|
||||
FC_ICL0126_9B(1342, 26, "Intentional Cookie Linker, for lowcase monsters"),
|
||||
FC_PDS6001_BC(1368, 60, "Personal Dating System, for babylonian cuneiform girls"),
|
||||
FC_SDS1201_AM(1428, 12, "Small Drowning Snow, for advanced missions outside"),
|
||||
|
|
|
|||
|
|
@ -35,6 +35,6 @@ public interface FourCornerX18CakePointDotName extends FourCornerX00PetitVide {
|
|||
String name(); // copy name from internal enum value
|
||||
|
||||
default List<Integer> nameX18() {
|
||||
return FourCornerUnicodeImport.strict().convertToX18(name());
|
||||
return FourCornerUnicodeImport.strict().convertToFC18(name());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ public class FourCornerZionStenoGrapher {
|
|||
}
|
||||
}
|
||||
|
||||
private void outAddBankCake(int bankBits, BigInteger bankMask, int cakeSel0, int cakeBank, int bankStart, BigInteger value, IntConsumer pipe, Function<Integer, Integer> overrideMsb) {
|
||||
private void sliceBankCake(int bankBits, BigInteger bankMask, int cakeSel0, int cakeBank, int bankStart, BigInteger value, IntConsumer pipe, Function<Integer, Integer> overrideMsb) {
|
||||
boolean strobePage = true;
|
||||
for (int i = bankStart; i >= 0; i--) {
|
||||
int bankValue = value.shiftRight(i * bankBits).and(bankMask).intValue();
|
||||
|
|
@ -164,7 +164,7 @@ public class FourCornerZionStenoGrapher {
|
|||
private void outAddBankCakeFC6(int bankBits, BigInteger bankMask,FCFlameFremanSuit suit, int bankStart, BigInteger value, Function<Integer, Integer> overrideMsb) {
|
||||
outAddAll(suit.escapeSequenceFC6().baklavaPointSequence());
|
||||
outAddAll(FCDotCDC1604DashP6.salt3SequenceWrite(new ArrayList<>(), suit.ordinal()));
|
||||
outAddBankCake(bankBits, bankMask, suit.cakeOffsetSel0(), suit.cakeOffsetBank(), bankStart, value, v -> {
|
||||
sliceBankCake(bankBits, bankMask, suit.cakeOffsetSel0(), suit.cakeOffsetBank(), bankStart, value, v -> {
|
||||
if (v < suit.cakeOffsetBank()) {
|
||||
int sel0 = v - suit.cakeOffsetSel0();
|
||||
outAdd(FCDotCDC1604DiceSaw.FACE_6NY.encodeOctal(sel0).baklavaPointDotIndex());
|
||||
|
|
@ -184,7 +184,7 @@ public class FourCornerZionStenoGrapher {
|
|||
if (outTongue.isSixBit()) {
|
||||
outAddBankCakeFC6(NCR_BANK8_BITS, BIG_BITS_8, suit, bankStart, value, overrideMsb);
|
||||
} else {
|
||||
outAddBankCake(NCR_BANK8_BITS, BIG_BITS_8, suit.cakeOffsetSel0(), suit.cakeOffsetBank(), bankStart, value, out, overrideMsb);
|
||||
sliceBankCake(NCR_BANK8_BITS, BIG_BITS_8, suit.cakeOffsetSel0(), suit.cakeOffsetBank(), bankStart, value, out, overrideMsb);
|
||||
}
|
||||
outFlush();
|
||||
}
|
||||
|
|
@ -193,13 +193,13 @@ public class FourCornerZionStenoGrapher {
|
|||
if (outTongue.isSixBit()) {
|
||||
outAddBankCakeFC6(NCR_BANK9_BITS, BIG_BITS_9, suit, bankStart, value, overrideMsb);
|
||||
} else {
|
||||
outAddBankCake(NCR_BANK9_BITS, BIG_BITS_9, suit.cakeOffsetSel0(), suit.cakeOffsetBank(), bankStart, value, out, overrideMsb);
|
||||
sliceBankCake(NCR_BANK9_BITS, BIG_BITS_9, suit.cakeOffsetSel0(), suit.cakeOffsetBank(), bankStart, value, out, overrideMsb);
|
||||
}
|
||||
outFlush();
|
||||
}
|
||||
|
||||
protected void outAddBankCake12(int cakeSel0, int cakeBank, int bankStart, BigInteger value, Function<Integer, Integer> overrideMsb) {
|
||||
outAddBankCake(NCR_BANK12_BITS, BIG_BITS_12, cakeSel0, cakeBank, bankStart, value, out, overrideMsb);
|
||||
sliceBankCake(NCR_BANK12_BITS, BIG_BITS_12, cakeSel0, cakeBank, bankStart, value, out, overrideMsb);
|
||||
outFlush();
|
||||
}
|
||||
|
||||
|
|
@ -338,7 +338,7 @@ public class FourCornerZionStenoGrapher {
|
|||
outAdd(FCDotCDC1604DiceSaw.FACE_3NX.encodeOctal(percentage).baklavaPointDotIndex());
|
||||
outAdd(FCDotCDC1604DiceSaw.FACE_2NX.encodeOctal(percentage).baklavaPointDotIndex());
|
||||
outAdd(FCDotCDC1604DiceSaw.FACE_1NX.encodeOctal(percentage).baklavaPointDotIndex());
|
||||
outAdd(FCDotCDC1604DashP6.NS04_RAKA1_INTERROBANG.cakePointDotIndex());
|
||||
outAdd(FCDotCDC1604DashP6.NS04_RAKA1_INTERROBANG.baklavaPointDotIndex());
|
||||
} else {
|
||||
outAdd(FourCornerDotCake.FC_CLK4K_SPACE.getStart() + percentage);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class FourCornerUnicodeImportTest {
|
|||
|
||||
@Test
|
||||
public void testAsciiUpper() throws Exception {
|
||||
List<Integer> cdc = FourCornerUnicodeImport.strict().convertToX06("FOOBAR");
|
||||
List<Integer> cdc = FourCornerUnicodeImport.strict().convertToFC6("FOOBAR");
|
||||
Assertions.assertNotNull(cdc);
|
||||
Assertions.assertFalse(cdc.isEmpty());
|
||||
Assertions.assertEquals(6, cdc.size());
|
||||
|
|
@ -58,7 +58,7 @@ public class FourCornerUnicodeImportTest {
|
|||
|
||||
@Test
|
||||
public void testAsciiLower() throws Exception {
|
||||
List<Integer> cdc = FourCornerUnicodeImport.strict().convertToX06("foobar");
|
||||
List<Integer> cdc = FourCornerUnicodeImport.strict().convertToFC6("foobar");
|
||||
Iterator<Integer> cdi = cdc.iterator();
|
||||
Assertions.assertNotNull(cdc);
|
||||
Assertions.assertFalse(cdc.isEmpty());
|
||||
|
|
@ -80,7 +80,7 @@ public class FourCornerUnicodeImportTest {
|
|||
|
||||
@Test
|
||||
public void testAsciiMixedX06() throws Exception {
|
||||
List<Integer> cdc = FourCornerUnicodeImport.strict().convertToX06("fooBAR");
|
||||
List<Integer> cdc = FourCornerUnicodeImport.strict().convertToFC6("fooBAR");
|
||||
Iterator<Integer> cdi = cdc.iterator();
|
||||
Assertions.assertNotNull(cdc);
|
||||
Assertions.assertFalse(cdc.isEmpty());
|
||||
|
|
@ -106,7 +106,7 @@ public class FourCornerUnicodeImportTest {
|
|||
|
||||
@Test
|
||||
public void testAsciiMixedX18() throws Exception {
|
||||
List<Integer> cdc = FourCornerUnicodeImport.strict().convertToX18("fooBAR");
|
||||
List<Integer> cdc = FourCornerUnicodeImport.strict().convertToFC18("fooBAR");
|
||||
Assertions.assertNotNull(cdc);
|
||||
Assertions.assertFalse(cdc.isEmpty());
|
||||
Assertions.assertEquals(6, cdc.size()); // = 108 bit
|
||||
|
|
@ -125,30 +125,30 @@ public class FourCornerUnicodeImportTest {
|
|||
@Test
|
||||
public void testCheckDiacritics() throws Exception {
|
||||
String foobar = "ꞘȍőḆẬř";
|
||||
List<Integer> cdc = FourCornerUnicodeImport.lossy().convertToX06(foobar);
|
||||
List<Integer> cdc = FourCornerUnicodeImport.lossy().convertToFC6(foobar);
|
||||
Assertions.assertNotNull(cdc);
|
||||
Assertions.assertFalse(cdc.isEmpty());
|
||||
Assertions.assertEquals("FOOBAR", FourCornerUnicodeDisplay.text().renderFromInt18(cdc));
|
||||
Assertions.assertThrows(IllegalArgumentException.class, () -> {
|
||||
FourCornerUnicodeImport.strict().convertToX06(foobar);
|
||||
FourCornerUnicodeImport.strict().convertToFC6(foobar);
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCheckMissingChar() throws Exception {
|
||||
String foobar = "FOO\u5432\u5432\u5432";
|
||||
List<Integer> cdc = FourCornerUnicodeImport.lossy().convertToX06(foobar);
|
||||
List<Integer> cdc = FourCornerUnicodeImport.lossy().convertToFC6(foobar);
|
||||
Assertions.assertNotNull(cdc);
|
||||
Assertions.assertFalse(cdc.isEmpty());
|
||||
Assertions.assertEquals("FOO¿¿¿", FourCornerUnicodeDisplay.text().renderFromInt18(cdc));
|
||||
Assertions.assertThrows(IllegalArgumentException.class, () -> {
|
||||
FourCornerUnicodeImport.strict().convertToX06(foobar);
|
||||
FourCornerUnicodeImport.strict().convertToFC6(foobar);
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNumberX06() throws Exception {
|
||||
List<Integer> cdc = FourCornerUnicodeImport.strict().convertToX06("01201337");
|
||||
List<Integer> cdc = FourCornerUnicodeImport.strict().convertToFC6("01201337");
|
||||
Iterator<Integer> cdi = cdc.iterator();
|
||||
Assertions.assertNotNull(cdc);
|
||||
Assertions.assertFalse(cdc.isEmpty());
|
||||
|
|
@ -172,7 +172,7 @@ public class FourCornerUnicodeImportTest {
|
|||
|
||||
@Test
|
||||
public void testNumberX18() throws Exception {
|
||||
List<Integer> cdc = FourCornerUnicodeImport.strict().convertToX18("01201337");
|
||||
List<Integer> cdc = FourCornerUnicodeImport.strict().convertToFC18("01201337");
|
||||
Assertions.assertNotNull(cdc);
|
||||
Assertions.assertFalse(cdc.isEmpty());
|
||||
Assertions.assertEquals(8, cdc.size());
|
||||
|
|
@ -191,7 +191,7 @@ public class FourCornerUnicodeImportTest {
|
|||
|
||||
@Test
|
||||
public void testLineEndings() throws Exception {
|
||||
List<Integer> cdc = FourCornerUnicodeImport.lossy().convertToX06("A\nB\rC\r\nD\nE\u001B\u0085F\n\r\n\r\r\n");
|
||||
List<Integer> cdc = FourCornerUnicodeImport.lossy().convertToFC6("A\nB\rC\r\nD\nE\u001B\u0085F\n\r\n\r\r\n");
|
||||
Iterator<Integer> cdi = cdc.iterator();
|
||||
Assertions.assertNotNull(cdc);
|
||||
Assertions.assertTrue(cdi.hasNext());
|
||||
|
|
@ -220,7 +220,7 @@ public class FourCornerUnicodeImportTest {
|
|||
@Test
|
||||
public void testWhiteSpace() throws Exception {
|
||||
String space16 = "\u3000\u205F\u202F\u200A\u2009\u2008\u2007\u2006\u2005\u2004\u2003\u2002\u2001\u2000\u00A0\u0020";
|
||||
List<Integer> cdc = FourCornerUnicodeImport.lossy().convertToX06(space16);
|
||||
List<Integer> cdc = FourCornerUnicodeImport.lossy().convertToFC6(space16);
|
||||
Iterator<Integer> cdi = cdc.iterator();
|
||||
Assertions.assertNotNull(cdc);
|
||||
Assertions.assertTrue(cdi.hasNext());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue