JPP: dial lingua removed hex encoding and sealed and split nether tones

This commit is contained in:
Willem Cazander 2026-01-28 00:00:22 +01:00
parent bfc9e511f6
commit 1c699c4c1b
3 changed files with 31 additions and 19 deletions

View file

@ -34,6 +34,5 @@ open module jpp.nether.dial.lingua {
//exports ᒢᐩᐩ.ᣕᓫᐪᑋᓫᣗ.ᒄᑊᣔᒻ.ᒻᑊᣕᕐᓑᣔᓫ.*;
exports ᒢᐩᐩ.ᣕᓫᐪᑋᓫᣗ.ᒄᑊᣔᒻ.ᒻᑊᣕᕐᓑᣔᓫ.ᐧᐧᐧ;
exports ᒢᐩᐩ.ᣕᓫᐪᑋᓫᣗ.ᒄᑊᣔᒻ.ᒻᑊᣕᕐᓑᣔᓫ.ᐧᐧᣟ;
exports ᒢᐩᐩ.ᣕᓫᐪᑋᓫᣗ.ᒄᑊᣔᒻ.ᒻᑊᣕᕐᓑᣔᓫ.ᐧᣟᐧ;
exports ᒢᐩᐩ.ᣕᓫᐪᑋᓫᣗ.ᒄᑊᣔᒻ.ᒻᑊᣕᕐᓑᣔᓫ.ᣟᣟᣟ;
}

View file

@ -62,7 +62,7 @@ public class ModelDialLingua implements KodeGenModel {
@Override
public String generatorModelHash() {
return "3";
return "4";
}
@Override
@ -114,20 +114,34 @@ public class ModelDialLingua implements KodeGenModel {
Map<String, List<NetherSlugNamed>> map = splitSlugs.get(pack);
for (String file : map.keySet()) {
List<NetherSlugNamed> list = map.get(file);
if (list.isEmpty()) {
continue;
}
NetherSlugNamed slugTpl = list.get(0);
List<Class<?>> tonesTpl = slugTpl.view().toNetherTones(0);
String javaName = "" + file;
ModelKlass klass = new ModelKlass(BASE_PACK + "." + pack, javaName);
for (Class<?> tone : tonesTpl) {
klass.addJavaImport(tone.getDeclaringClass().getName()); // auto dedup
}
klass.addJavaDescription("Lingua set of supported human text and vocal dialects for terminators.");
klass.addJavaDescription("Keyed by the: Observatoire Human Linguistique");
writer.addModelKlass(klass);
StringBuilder buf = klass.getBody();
buf.append("public interface ");
buf.append("public sealed interface ");
buf.append(javaName);
buf.append(" extends ");
for (Iterator<Class<?>> i = tonesTpl.subList(0, 4).iterator(); i.hasNext() ;) {
Class<?> toneClass = i.next();
buf.append(toneClass.getDeclaringClass().getSimpleName());
buf.append(".");
buf.append(toneClass.getSimpleName());
if (i.hasNext()) {
buf.append(", ");
}
}
buf.append(" {\n");
for (NetherSlugNamed slug : list) {
List<Class<?>> tones = slug.view().toNetherTones(0);
for (Class<?> tone : tones) {
klass.addJavaImport(tone.getDeclaringClass().getName()); // auto dedup
}
String humanKlassPart = slug.linguaName();
humanKlassPart = humanKlassPart.replaceAll("\\-", "");
humanKlassPart = humanKlassPart.replaceAll("\\+", "");
@ -140,16 +154,19 @@ public class ModelDialLingua implements KodeGenModel {
buf.append(slug.linguaKey);
buf.append("\n");
buf.append("\t");
buf.append("interface ");
buf.append("non-sealed interface ");
buf.append(slugName);
buf.append(" extends ");
for (Iterator<Class<?>> i = tones.iterator(); i.hasNext() ;) {
buf.append(javaName);
buf.append(", ");
List<Class<?>> tones = slug.view().toNetherTones(0);
for (Iterator<Class<?>> i = tones.subList(4, tones.size()).iterator(); i.hasNext() ;) {
Class<?> toneClass = i.next();
buf.append(toneClass.getDeclaringClass().getSimpleName());
buf.append(".");
buf.append(toneClass.getSimpleName());
if (i.hasNext()) {
buf.append(",");
buf.append(", ");
}
}
buf.append(" {}\n");
@ -193,7 +210,7 @@ public class ModelDialLingua implements KodeGenModel {
int ag1 = LINGUA_AG1;
int ag2 = LINGUA_AG2;
int ag3 = LINGUA_AG3;
int bl0w = 1+Integer.parseInt(key1, 16);
int bl0w = 1+Integer.parseInt(key1);
int cr1 = key2.length()<1?0:1+key2.charAt(0) - 'A'; // A = 1
int cr2 = key2.length()<2?0:1+key2.charAt(1) - 'A';
int cr3 = key2.length()<3?0:1+key2.charAt(2) - 'A';