diff --git a/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/dutch/DutchBuildingBlocks.java b/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/dutch/DutchBuildingBlocks.java index 4e0f943..52e9a80 100644 --- a/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/dutch/DutchBuildingBlocks.java +++ b/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/dutch/DutchBuildingBlocks.java @@ -36,10 +36,10 @@ public String fromIso(Iso8601Age ppktAge) { components.add(String.format("%d %s", y, years(y))); } if (m > 0) { - components.add(String.format("%d %s", m, months(y))); + components.add(String.format("%d %s", m, months(m))); } if (d > 0) { - components.add(String.format("%d %s", d, days(y))); + components.add(String.format("%d %s", d, days(d))); } return String.join(" ", components); } @@ -80,7 +80,7 @@ public String yearsMonthsDaysOld(int y, int m, int d) { } else if (d==0) { return String.format("%d jaar en %d maand oud", y, m); } else if (d==1){ - return String.format("%d maand en %d dag oud", y, d); + return String.format("%d jaar, %d maand en %d dag oud", y, m, d); } else return String.format("%d jaar, %d maand en %d dagen oud", y, m, d); } diff --git a/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/english/EnglishBuildingBlocks.java b/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/english/EnglishBuildingBlocks.java index 82abffa..f8f6f5d 100644 --- a/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/english/EnglishBuildingBlocks.java +++ b/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/english/EnglishBuildingBlocks.java @@ -36,10 +36,10 @@ public String fromIso(Iso8601Age ppktAge) { components.add(String.format("%d %s", y, years(y))); } if (m > 0) { - components.add(String.format("%d %s", m, months(y))); + components.add(String.format("%d %s", m, months(m))); } if (d > 0) { - components.add(String.format("%d %s", d, days(y))); + components.add(String.format("%d %s", d, days(d))); } return String.join(" ", components); } diff --git a/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/german/GermanBuildingBlocks.java b/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/german/GermanBuildingBlocks.java index 20755cb..fb2e2eb 100644 --- a/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/german/GermanBuildingBlocks.java +++ b/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/german/GermanBuildingBlocks.java @@ -141,17 +141,17 @@ public String child() { @Override public String adolescentGirl() { - return ""; + return "Jugendliche"; } @Override public String adolescentBoy() { - return ""; + return "Jugendlicher"; } @Override public String adolescentChild() { - return ""; + return "Jugendlicher"; } @Override diff --git a/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/german/PpktIndividualGerman.java b/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/german/PpktIndividualGerman.java index 6c1a084..0814f7b 100644 --- a/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/german/PpktIndividualGerman.java +++ b/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/german/PpktIndividualGerman.java @@ -201,11 +201,14 @@ private String imAlterVonIsoAgeExact(PhenopacketAge ppktAge) { return String.format("Im Alter von %d %s", y, y>1?"Jahren" : "Jahr"); } } - if (m>0) { - return String.format("Im Alter von %d %s y %d %s", m, m>1?"Monaten" : "Monat", + if (m>0 && d>0) { + return String.format("Im Alter von %d %s und %d %s", m, m>1?"Monaten" : "Monat", d, d>1?"Tagen" : "Tag"); - } else { - return String.format("%d Tage", d); + } else if (m>0 && d==0) { + return String.format("Im Alter von %d %s", m, m>1?"Monaten" : "Monat"); + } + else { + return String.format("Im Alter von %d %s", d, d>1?"Tagen" : "Tag"); } } @@ -227,24 +230,24 @@ private String iso8601individualDescription(PhenopacketSex psex, Iso8601Age iso8 }; } else if (y > 9) { return switch (psex) { - case FEMALE -> String.format("%s %s %s", bbGenerator.probandWasA(), + case FEMALE -> String.format("%s eine %s %s", bbGenerator.probandWasA(), dAlter(iso8601Age, GrammatikalischesGeschlecht.WEIBLICH), bbGenerator.adolescentGirl()); - case MALE -> String.format("%s %s %s", bbGenerator.probandWasA(), + case MALE -> String.format("%s ein %s %s", bbGenerator.probandWasA(), dAlter(iso8601Age, GrammatikalischesGeschlecht.MAENNLICH), bbGenerator.adolescentBoy()); - default -> String.format("%s %s %s", bbGenerator.probandWasA(), + default -> String.format("%s ein %s %s", bbGenerator.probandWasA(), dAlter(iso8601Age, GrammatikalischesGeschlecht.NEUTRUM), bbGenerator.adolescentChild()); }; } else if (y > 0) { return switch (psex) { - case FEMALE -> String.format("%s %s %s", bbGenerator.probandWasA(), + case FEMALE -> String.format("%s ein %s %s", bbGenerator.probandWasA(), dAlter(iso8601Age, GrammatikalischesGeschlecht.NEUTRUM), // "das Mädchen" bbGenerator.girl()); case MALE -> String.format("%s ein %s %s", bbGenerator.probandWasA(), dAlter(iso8601Age, GrammatikalischesGeschlecht.MAENNLICH), bbGenerator.boy()); - default -> String.format("%s %s %s", bbGenerator.probandWasA(), + default -> String.format("%s ein %s %s", bbGenerator.probandWasA(), dAlter(iso8601Age, GrammatikalischesGeschlecht.NEUTRUM), // Das Individuum bbGenerator.child()); }; @@ -300,7 +303,7 @@ private String dAlter(Iso8601Age iso8601Age, GrammatikalischesGeschlecht geschle return switch (geschlecht) { case MAENNLICH -> String.format("%s alter", ymd); case WEIBLICH -> String.format("%s alte", ymd); - case NEUTRUM -> String.format("%s alte", ymd); + case NEUTRUM -> String.format("%s altes", ymd); //TODO: check this is OK. "alte" in the examples I have seen always refers to "die Person", which is feminine, e.g. "46 Jahre alte erwachsene Person", not "altes" }; } diff --git a/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/italian/ItalianPromptGenerator.java b/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/italian/ItalianPromptGenerator.java index 28a8a0f..1dc83b1 100644 --- a/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/italian/ItalianPromptGenerator.java +++ b/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/italian/ItalianPromptGenerator.java @@ -56,8 +56,8 @@ public String getVignetteAtAge(PhenopacketAge page, PhenopacketSex psex, List "Lui"; - case FEMALE -> "Lei"; + case MALE -> "Il paziente"; + case FEMALE -> "La paziente"; default -> "La persona"; }; return this.ppktPhenotypicFeatureGenerator.featuresAtOnset(person, individual.getPhenotypicFeaturesAtOnset()); diff --git a/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/italian/PpktIndividualItalian.java b/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/italian/PpktIndividualItalian.java index 1e9a8de..ff55a59 100644 --- a/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/italian/PpktIndividualItalian.java +++ b/src/main/java/org/monarchinitiative/phenopacket2prompt/output/impl/italian/PpktIndividualItalian.java @@ -144,10 +144,15 @@ private String atIsoAgeExact(PhenopacketAge ppktAge) { } else { return String.format("%d anni", y); } - } else if (m>0) { + } else if (m>0 && d>0) { return String.format("%d mesi e %d giorni", m, d); } else { - return String.format("%d giorni", d); + if (m>0 && d==0) { + return String.format("%d mesi", m); + } + else { + return String.format("%d giorni", d); + } } } @@ -272,8 +277,8 @@ private String hpoOnsetIndividualDescription(PhenopacketSex psex, HpoOnsetAge hp @Override public String heSheIndividual(PhenopacketSex psex) { return switch (psex) { - case FEMALE -> "lei"; - case MALE -> "lui"; + case FEMALE -> "la paziente"; + case MALE -> "il paziente"; default -> "il soggetto"; }; } diff --git a/src/test/java/org/monarchinitiative/phenopacket2prompt/output/impl/italian/PpktIndividualItalianTest.java b/src/test/java/org/monarchinitiative/phenopacket2prompt/output/impl/italian/PpktIndividualItalianTest.java index bcdbb18..d2d4667 100644 --- a/src/test/java/org/monarchinitiative/phenopacket2prompt/output/impl/italian/PpktIndividualItalianTest.java +++ b/src/test/java/org/monarchinitiative/phenopacket2prompt/output/impl/italian/PpktIndividualItalianTest.java @@ -56,9 +56,9 @@ void testEvaluateExpression(TestIndividual testCase) { private static Stream testGetPPKtSex() { return Stream.of( new TestIdvlHeShe("female", - PhenopacketSex.FEMALE, new TestOutcome.Ok("lei")), + PhenopacketSex.FEMALE, new TestOutcome.Ok("la paziente")), new TestIdvlHeShe("male", - PhenopacketSex.MALE, new TestOutcome.Ok("lui")), + PhenopacketSex.MALE, new TestOutcome.Ok("il paziente")), new TestIdvlHeShe("proband", PhenopacketSex.UNKNOWN, new TestOutcome.Ok("il soggetto")) );