From 32ff4196fe2fe00f00cc04fd9669beed9f5c17d3 Mon Sep 17 00:00:00 2001 From: hammera Date: Tue, 11 Aug 2026 09:35:25 +0200 Subject: [PATCH 1/4] Add few tweaks into the Rules/Languages/hu/definitions.yaml file, Added missing definitions.rs test file the test/Languages/hu directory, and added SimpleSpeak test directory the mroot and menclose tests (#646) * Do more localization in Rules/Languages/hu/definitions.yaml Signed-off-by: Attila Hammer * Add in Simplespeak tests the definition, mroot and menclose tests Signed-off-by: Attila Hammer * fix some werbs in intervals into rules/Languages/hu/ClearSpeak_rules.yaml and SimpleSpeak_rules.yaml Signed-off-by: Attila Hammer * Fix tests after interval Clearspeak and SimpleSpeak verb change Signed-off-by: Attila Hammer --------- Signed-off-by: Attila Hammer --- Rules/Languages/hu/ClearSpeak_Rules.yaml | 4 +- Rules/Languages/hu/SimpleSpeak_Rules.yaml | 4 +- Rules/Languages/hu/definitions.yaml | 99 +- tests/Languages/hu.rs | 5 +- tests/Languages/hu/ClearSpeak/functions.rs | 16 +- tests/Languages/hu/SimpleSpeak/functions.rs | 12 +- tests/Languages/hu/SimpleSpeak/menclose.rs | 266 +++++ tests/Languages/hu/SimpleSpeak/mroot.rs | 178 ++++ tests/Languages/hu/definitions.rs | 1026 +++++++++++++++++++ tests/Languages/hu/shared.rs | 2 +- 10 files changed, 1542 insertions(+), 70 deletions(-) create mode 100644 tests/Languages/hu/SimpleSpeak/menclose.rs create mode 100644 tests/Languages/hu/SimpleSpeak/mroot.rs create mode 100644 tests/Languages/hu/definitions.rs diff --git a/Rules/Languages/hu/ClearSpeak_Rules.yaml b/Rules/Languages/hu/ClearSpeak_Rules.yaml index 02040fc5d..73d8eaf5e 100644 --- a/Rules/Languages/hu/ClearSpeak_Rules.yaml +++ b/Rules/Languages/hu/ClearSpeak_Rules.yaml @@ -623,7 +623,7 @@ - test: if: "starts-with(name(.), 'open')" then: [T: "nem"] # phrase(the interval from a to b 'not' including b) - - T: "tartalmazza a" # phrase(the interval from a to b not 'including' b) + - T: "tartalmazza a(z)" # phrase(the interval from a to b not 'including' b) - x: "*[1]" - T: "elemet" # logic to deal with [not] arg #1 @@ -647,7 +647,7 @@ if: "name(.) = 'open-interval' or name(.) = 'closed-open-interval'" then: [T: "nem"] # phrase(the interval 'not' including a) - T: "tartalmazza" # phrase(the interval not 'including' a) - - T: "a" + - T: "a(z)" - x: "*[2]" - T: "elemet" # onto the [not] [including]... part diff --git a/Rules/Languages/hu/SimpleSpeak_Rules.yaml b/Rules/Languages/hu/SimpleSpeak_Rules.yaml index b5f263c3a..5037a4122 100644 --- a/Rules/Languages/hu/SimpleSpeak_Rules.yaml +++ b/Rules/Languages/hu/SimpleSpeak_Rules.yaml @@ -574,7 +574,7 @@ - test: if: "starts-with(name(.), 'open')" then: [T: "nem"] # phrase(the interval from a to b 'not' including b) - - T: "tartalmazza a" # phrase(the interval from a to b not 'including' b) + - T: "tartalmazza a(z)" # phrase(the interval from a to b not 'including' b) - x: "*[1]" - T: "elemet" # logic to deal with [not] arg #1 @@ -598,7 +598,7 @@ if: "name(.) = 'open-interval' or name(.) = 'closed-open-interval'" then: [T: "nem"] # phrase(the interval 'not' including a) - T: "tartalmazza" # phrase(the interval not 'including' a) - - T: "a" + - T: "a(z)" - x: "*[2]" - T: "elemet" # onto the [not] [including]... part diff --git a/Rules/Languages/hu/definitions.yaml b/Rules/Languages/hu/definitions.yaml index c0e75bee2..bdc649424 100644 --- a/Rules/Languages/hu/definitions.yaml +++ b/Rules/Languages/hu/definitions.yaml @@ -23,28 +23,28 @@ #"closed-open-interval":"function=interval between; included and", #"open-closed-interval":"function=interval between; and included", #"open-interval":"function=open interval between; and", - "inverse":"function=inverse || postfix=inverse", + "inverse":"function=inverz || postfix=inverz", "domain": "function= ; domén", "codomain": "function= ; kodomán", - "image":"function=image", + "image":"function=kép", #"fraction":"function=fraction; over; end fraction", # NOTE: Fails - "mixed-fraction":"infix=and", # NOTE: in website says function, but follow infix speech pattern. - "greatest-common-divisor": "function=gcd: a GCD: a legnagyobb közös osztó", - "quotient":"function=szám rész; osztva ezzel:", # NOTE: Logic somewhere here failing, becomes "divided by of x comma, y" instead of "integer part of x divided by y" - "evaluated-at":"infix=értékelték", - "remainder":"function=a maradék; osztva ezzel:", + "mixed-fraction":"infix=és", # NOTE: in website says function, but follow infix speech pattern. + "greatest-common-divisor": "function=a legnagyobb közös osztó", + "quotient":"function=egész rész osztva", # NOTE: Logic somewhere here failing, becomes "divided by of x comma, y" instead of "integer part of x divided by y" + "evaluated-at":"infix=értékelve || postfix=értékként", + "remainder":"function=a maradék, osztva", "max":"function=max", "min":"function=min", "power":"infix=a hatványra", "root":"function=root", - "imaginary-part": "function=képzeletbeli rész: a képzeletbeli rész: a képzeletbeli rész", + "imaginary-part": "a képzeletbeli rész", "least-common-multiple": "function=lcm: a legkisebb közös többszörös: a legkisebb közös többszörös", "complex-conjugate":"function=Komplex konjugált", "complex-arg":"function=argumentum", - "polar-coordinate":"function=poláris koordináta; vessző", - "spherical-coordinate":"function=gömb koordináta; vessző; vessző", - "cartesian-coordinate":"function=derékszögű koordináta; vessző", - "coordinate":"function=koordináta; vessző", + "polar-coordinate":"function=poláris koordináta", + "spherical-coordinate":"function=gömb koordináta", + "cartesian-coordinate":"function=derékszögű koordináta", + "coordinate":"function=koordináta", "floor":"function=lépcső", "ceiling":"function=mennyezet", "round":"function=kerekített érték", @@ -60,7 +60,7 @@ "dimension": "function=; dimenzió : dimenzió: a dimenzió; dimenzió vége", "homomorphism": "function= ; homomorfizmus : homomorfizmus: a homomorfizmus; homomorfizmus vége", "kernel": "function= ; kernel : kernel: a kernel; kernel vége", - "dot-product": "infix=skaláris szorzat: skaláris szorzat: skaláris szorzat: skaláris szorzat", + "dot-product": "infix=skaláris szorzat", #"divergence": "function= ; dihv: divergencia: divergencia; divergencia vége", #"laplacian": "function=laplaciáns", # speech engines don't do a good job with "laplacian" @@ -69,19 +69,20 @@ ### Calculus "definite-integral":"function=integrál felett || function=integrál innen:; ide:", # Property ??? "derivative":"function=a deriváltja; mely erre vonatkozik:", # Property ??? - "tends-to":"infix=általában", + "tends-to":"infix=ehhez tart", "tends-to-from-above":"infix=általában alulról indul", - + "tends-to-from-below":"infix=alulról indul", ### Sets "set": "function= ; halmaz: a halmaz", + "set-difference":"function=különbséghalmaz || infix=mínusz || postfix=különbséghalmaza", # NOTE: not tested "complement":"function=komplemens", - "empty-set":"nofix=üres halmaz", + "empty-set":"function=üres halmaz", "cardinality":"function=számosság", # NOTE: does not have a defined speech template in website "list":"function=lista", "tuple": "function= ; tuple: a tuple", ### Sequence and Series "sum":"function= ; összegzés : összeg ; ", #: sum over : sum from; to", - "product":"function=produktum || function=produktum vége || function=produktum innen:; ide:", + "product":"function=szorzat || function=szorzat vége || function=szorzat innen ide", ### Elementary classical functions "sine":"function=szinusz: szinusz", @@ -91,23 +92,23 @@ "cosecant":"function=koszekáns: koszekáns", "cotangent":"function=kotangens: kotangens", "arcsine":"function=arkusz szinusz", - #"arccosine":"function=arkusz koszinusz", + "arccosine":"function=arkusz koszinusz", "arctangent":"function=arkusz tangens", "arcsecant":"function=arkusz szekáns", "arccosecant":"function=arkusz koszekáns", "arccotangent":"function=arkusz kotangens", "hyperbolic-sine":"function=hiperbolikus szinusz", "hyperbolic-cosine":"function=hiperbolikus koszinusz", - "hyperbolic-tangent":"function=hiperbolikus tangenstanch", - "hyperbolic-secant":"function=sech", - "hyperbolic-cosecant":"function=cosech", - "hyperbolic-cotangent":"function=coth", - "arc-hyperbolic-sine":"function=arc shine", - "arc-hyperbolic-cosine":"function=arc cosh", - "arc-hyperbolic-tangent":"function=arc tanch", - "arc-hyperbolic-secant":"function=arc sech", - "arc-hyperbolic-cosecant":"function=arc cosech", - "arc-hyperbolic-cotangent":"function=arc coth", + "hyperbolic-tangent":"function=hiperbolikus tangens", + "hyperbolic-secant":"function=hiperbolikus szekáns", + "hyperbolic-cosecant":"function=hiperbolikus koszekáns", + "hyperbolic-cotangent":"function=hiperbolikus kotangens", + "arc-hyperbolic-sine":"function=arkusz hiperbolikus szinusz", + "arc-hyperbolic-cosine":"function=arkusz hiperbolikus koszinusz", + "arc-hyperbolic-tangent":"function=arkusz hiperbolikus tangens", + "arc-hyperbolic-secant":"function=arkusz hiperbolikus szekáns", + "arc-hyperbolic-cosecant":"function=arkusz hiperbolikus koszekáns", + "arc-hyperbolic-cotangent":"function=arkusz hiperbolikus kotangens", "exponential":"function=exponenciális", "natural-logarithm": "function=l n: természetes alapú logaritmus: természetes alapú logaritmus", "logarithm":"function=logaritmus", ##Check arity 2 @@ -138,7 +139,7 @@ ### Constants and Sets "set-of-integers":"nofix=ℤ: az összes egész szám halmaza", - "set-of-reals":"nofix=ℝ: az összes valós szám halmaza", + "set-of-reals":"nofix=valós számok halmaza: az összes valós szám halmaza", "set-of-rationals":"nofix=ℚ: az összes racionális szám halmaza", "set-of-natural-numbers":"nofix=ℕ: az összes természetes szám halmaza", "set-of-complex-numbers":"nofix=ℂ: az összes komplex szám halmaza", @@ -167,13 +168,13 @@ "highlight":"postfix=kiemelt", "least-common-denominator":"function=legkisebb közös nevező", "rate":"infix=per", - "constraint":"infix= ; korlátozással; ", + "constraint":"infix= ; feltétellel; ", "binomial-coefficient":"infix=választ", "pochhammer":"function=permutáció", "permutation-cycle":"function=permutációs ciklus", - "embellished-name":"infix=jegyzetekkel", - + "embellished-name":"infix=megjegyzéssel", + "annotation":"infix= ; ami ;", # NOTE: Follows the same order as indexed-by, in site listed as function. Should it be infix? ### Other ## Default fixity function "curl": "function=rotáció", @@ -185,7 +186,7 @@ "angle": "prefix=szög", "angle-measure": "prefix=szögmérés", "change": "prefix=változás", - "for-all": "prefix=mindenkinek", + "for-all": "prefix=minden", "measured-angle": "prefix=mért szög", "not": "prefix=nem", "number-of": "prefix=száma", @@ -198,7 +199,7 @@ ## Default fixity infix "and": "infix=és", - "applied-to": "infix=alkalmazva erre", + "applied-to": "infix=alkalmazva", "approximately": "infix=hozzávetőlegesen", "congruent": "infix=egybeesik", "cartesian-product": "infix=derékszögű szorzat", @@ -210,7 +211,7 @@ "does-not-belong-to": "infix=nem tartozik hozzá", "does-not-divide": "infix=nem osztja", "downwards-diagonal-ellipsis": "infix=lefelé mutató átlós ellipszis", - "direct-product": "infix=direkt produktum", + "direct-product": "infix=direkt szorzat", "element-of": "infix=eleme", "ellipsis": "infix=ellipszis", "equals": "infix=egyenlő", @@ -222,7 +223,7 @@ "identically-equals": "infix=teljesen egyenlő", "if-and-only-if": "infix=akkor és csak akkor, ha", "implies": "infix=utal", - "inner-product": "infix=belső produktum", + "inner-product": "infix=belső szorzat", "intersection": "infix=keresztezi", "less-than": "infix=kisebb, mint", "less-than-or-equal-to": "infix=kisebb vagy egyenlő, mint", @@ -231,13 +232,13 @@ "member-of": "infix=tagja", "minus-or-plus": "infix=mínusz vagy plusz", "not-subset": "infix=nem részhalmaza", - "not-superset": "infix=nem szuperhalmaz", + "not-superset": "infix=nem szuperhalmaza", "not-equal-to": "infix=nem egyenlő", "not-member-of": "infix=nem tagja", "not-parallel-to": "infix=nem párhuzamos", - "obtained-from": "infix=származó", + "obtained-from": "infix=innen származik", "or": "infix=vagy", - "outer-product": "infix=külső produktum", + "outer-product": "infix=külső szorzata", "parallel-to": "infix=párhuzamos", "perpendicular": "infix=merőleges", "plus": "infix=plusz || prefix=pozitív", # Prefix not tested @@ -246,16 +247,16 @@ "precedes": "infix=megelőzi", "proportional": "infix=arányos", "range-separator": "infix=keresztül", - "ratio": "infix=hányados", + "ratio": "infix=arány", "similar": "infix=hasonló", "subset": "infix=részhalmaza", "subset-or-equal": "infix=részhalmaza vagy egyenlő", - "succeeds": "infix=sikerül", + "succeeds": "infix=követi", "such-that": "infix=úgy, hogy", "superset": "infix=szuperhalmaza", - "superset-or-equal": "infix=szuperhalmaz vagy egyenlő", + "superset-or-equal": "infix=szuperhalmaza vagy egyenlő", "tilde": "infix=tilde", - "times": "infix=szorzata", + "times": "infix=szorozva", "union": "infix=unió", "upwards-diagonal-ellipsis": "infix=felfelé átlós ellipszis", "vertical-ellipsis": "infix=függőleges ellipszis", @@ -270,9 +271,9 @@ "distance":"nofix=távolság; távolság: távolság", "probability":"nofix=P: valószínűség", "radius":"nofix=r: sugár", - "volume":"nofix=V: hangerő || function=", + "volume":"nofix=hangerő: hangerő || function=hangerő", "exponential-e":"nofix=e", - "imaginary-i":"nofix=i", + "imaginary-i":"nofix=képzeletbeli én", "differential-d":"nofix=d", "golden-ratio":"nofix=aranymetszés", @@ -290,11 +291,11 @@ # These are the parts of a formula that can be navigated to "large-op": "base; lower limit; upper limit", "mfrac": "numerator; denominator", - "fraction": "numerator; denominator", - "msqrt": "root", - "square-root": "root", + "fraction": "számláló; nevező", + "msqrt": "gyök", + "square-root": "gyök", "mroot": "root; root index", - "root": "root; root index", + "root": "gyök; gyök index", "msub": "base; subscript", "sub": "base; subscript", "logarithm-with-base": "base", diff --git a/tests/Languages/hu.rs b/tests/Languages/hu.rs index 45bce3f9c..ac24dd22e 100644 --- a/tests/Languages/hu.rs +++ b/tests/Languages/hu.rs @@ -15,9 +15,9 @@ mod ClearSpeak { mod SimpleSpeak { mod functions; mod large_ops; - // mod menclose; + mod menclose; mod mfrac; - // mod mroot; + mod mroot; mod msup; mod sets; mod geometry; @@ -29,6 +29,7 @@ mod shared; mod units; mod chemistry; mod alphabets; +mod definitions; mod intent; mod mtable; diff --git a/tests/Languages/hu/ClearSpeak/functions.rs b/tests/Languages/hu/ClearSpeak/functions.rs index e9449b213..3dd6e94e7 100644 --- a/tests/Languages/hu/ClearSpeak/functions.rs +++ b/tests/Languages/hu/ClearSpeak/functions.rs @@ -516,7 +516,7 @@ fn explicit_times_none_superscript() -> Result<()> { ) "; test_ClearSpeak("hu", "ClearSpeak_Paren", "Interval",expr, - "c től d ig terjedő intervallum, nem tartalmazza a c elemet vagy d elemet")?; + "c től d ig terjedő intervallum, nem tartalmazza a(z) c elemet vagy d elemet")?; return Ok(()); } @@ -530,7 +530,7 @@ fn explicit_times_none_superscript() -> Result<()> { ) "; test_ClearSpeak("hu", "ClearSpeak_Paren", "Interval ",expr, - "c től d ig terjedő intervallum, tartalmazza a c elemet de nem tartalmazza a d elemet")?; + "c től d ig terjedő intervallum, tartalmazza a(z) c elemet de nem tartalmazza a(z) d elemet")?; return Ok(()); } @@ -545,7 +545,7 @@ fn parens_interval_open_closed() -> Result<()> { ] "; test_ClearSpeak("hu", "ClearSpeak_Paren", "Interval ",expr, - "c től d ig terjedő intervallum, nem tartalmazza a c elemet de tartalmazza a d elemet")?; + "c től d ig terjedő intervallum, nem tartalmazza a(z) c elemet de tartalmazza a(z) d elemet")?; return Ok(()); } @@ -560,7 +560,7 @@ fn parens_interval_closed_closed() -> Result<()> { ] "; test_ClearSpeak("hu", "ClearSpeak_Paren", "Interval ",expr, -"c től d ig terjedő intervallum, tartalmazza a c elemet és d elemet")?; +"c től d ig terjedő intervallum, tartalmazza a(z) c elemet és d elemet")?; return Ok(()); } @@ -573,7 +573,7 @@ return Ok(()); ) "; test_ClearSpeak("hu", "ClearSpeak_Paren", "Interval ",expr, - "negatív végtelen től d ig terjedő intervallum, nem tartalmazza a d elemet")?; + "negatív végtelen től d ig terjedő intervallum, nem tartalmazza a(z) d elemet")?; return Ok(()); } @@ -586,7 +586,7 @@ return Ok(()); ] "; test_ClearSpeak("hu", "ClearSpeak_Paren", "Interval ",expr, - "negatív végtelen től d ig terjedő intervallum, tartalmazza a d elemet")?; + "negatív végtelen től d ig terjedő intervallum, tartalmazza a(z) d elemet")?; return Ok(()); } @@ -601,7 +601,7 @@ fn parens_interval_open_open_infinity() -> Result<()> { ) "; test_ClearSpeak("hu", "ClearSpeak_Paren", "Interval ",expr, - "c től végtelen ig terjedő intervallum, nem tartalmazza a c elemet")?; + "c től végtelen ig terjedő intervallum, nem tartalmazza a(z) c elemet")?; return Ok(()); } @@ -616,7 +616,7 @@ fn parens_interval_closed_open_infinity() -> Result<()> { ) "; test_ClearSpeak("hu", "ClearSpeak_Paren", "Interval ",expr, -"c től végtelen ig terjedő intervallum, tartalmazza a c elemet")?; +"c től végtelen ig terjedő intervallum, tartalmazza a(z) c elemet")?; return Ok(()); } diff --git a/tests/Languages/hu/SimpleSpeak/functions.rs b/tests/Languages/hu/SimpleSpeak/functions.rs index aa4c2a43a..8ecf02cb8 100644 --- a/tests/Languages/hu/SimpleSpeak/functions.rs +++ b/tests/Languages/hu/SimpleSpeak/functions.rs @@ -355,7 +355,7 @@ fn no_times_sqrt() -> Result<()> { (c,d) ) "; - test("hu", "SimpleSpeak",expr, "c től d ig terjedő intervallum, nem tartalmazza a c elemet vagy d elemet")?; + test("hu", "SimpleSpeak",expr, "c től d ig terjedő intervallum, nem tartalmazza a(z) c elemet vagy d elemet")?; return Ok(()); } @@ -368,7 +368,7 @@ fn no_times_sqrt() -> Result<()> { [(]c,d) ) "; - test("hu", "SimpleSpeak",expr, "c től d ig terjedő intervallum, tartalmazza a c elemet de nem tartalmazza a d elemet")?; + test("hu", "SimpleSpeak",expr, "c től d ig terjedő intervallum, tartalmazza a(z) c elemet de nem tartalmazza a(z) d elemet")?; return Ok(()); } @@ -382,7 +382,7 @@ fn parens_interval_open_closed() -> Result<()> { (c,d] ] "; - test("hu", "SimpleSpeak",expr,"c től d ig terjedő intervallum, nem tartalmazza a c elemet de tartalmazza a d elemet")?; + test("hu", "SimpleSpeak",expr,"c től d ig terjedő intervallum, nem tartalmazza a(z) c elemet de tartalmazza a(z) d elemet")?; return Ok(()); } @@ -396,7 +396,7 @@ fn parens_interval_closed_closed() -> Result<()> { [(]c,d] ] "; - test("hu", "SimpleSpeak",expr, "c től d ig terjedő intervallum, tartalmazza a c elemet és d elemet")?; + test("hu", "SimpleSpeak",expr, "c től d ig terjedő intervallum, tartalmazza a(z) c elemet és d elemet")?; return Ok(()); } @@ -409,7 +409,7 @@ fn parens_interval_closed_closed() -> Result<()> { ) "; test("hu", "SimpleSpeak",expr, - "negatív végtelen től d ig terjedő intervallum, nem tartalmazza a d elemet")?; + "negatív végtelen től d ig terjedő intervallum, nem tartalmazza a(z) d elemet")?; return Ok(()); } @@ -422,7 +422,7 @@ fn parens_interval_closed_closed() -> Result<()> { ] "; test("hu", "SimpleSpeak",expr, - "negatív végtelen től d ig terjedő intervallum, tartalmazza a d elemet")?; + "negatív végtelen től d ig terjedő intervallum, tartalmazza a(z) d elemet")?; return Ok(()); } diff --git a/tests/Languages/hu/SimpleSpeak/menclose.rs b/tests/Languages/hu/SimpleSpeak/menclose.rs new file mode 100644 index 000000000..33c03f699 --- /dev/null +++ b/tests/Languages/hu/SimpleSpeak/menclose.rs @@ -0,0 +1,266 @@ +use crate::common::*; +use anyhow::Result; + +// AI generated +#[test] +fn menclose_actuarial() -> Result<()> { + let expr = " + 3+2i + "; + test("hu", "ClearSpeak", expr, "aktuárius szimbólum, kezdet: 3 plusz 2 i végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_box() -> Result<()> { + let expr = " + 3+2i + "; + test("hu", "ClearSpeak", expr, "doboz, kör, kezdet: 3 plusz 2 i végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_left() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "vonal balra, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_right() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "vonal jobbra, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_top_bottom() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "vonal felső, alsó, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_updiagonalstrike() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "átlósan felfelé, kihúzva, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_downdiagonalstrike() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "átlósan lefelé, kihúzva, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_cross_out() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "x, kihúzva, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_vertical_horizontal_strike() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "függőleges, vízszintes, kihúzva, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_leftarrow() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "balra nyíl, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_right_up_down_arrow() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "felfelé nyíl, lefelé nyíl, jobbra nyíl, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_northeastarrow() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "északkeleti nyíl, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_other_single_arrows() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "délkeleti nyíl, délnyugati nyíl, északnyugati nyíl, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_northwestsoutheastarrow() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "kétvégű lefelé mutató átlós nyíl, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_other_double_arrows() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "kétvégű függőleges nyíl, kétvégű vízszintes nyíl, dupla végű átlós nyíl, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_madrub() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "arab faktoriális szimbólum, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_phasorangle() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "fázisszög, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_circle_phasorangle() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "kör, fázisszög, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_longdiv() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "hosszú osztásjel, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_longdiv_default() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "hosszú osztásjel, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_longdiv_empty_string() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "hosszú osztásjel, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_longdiv_whitespace_string() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "hosszú osztásjel, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn menclose_radical() -> Result<()> { + let expr = " + 32 + "; + test("hu", "ClearSpeak", expr, "négyzetgyök, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn simple_speak_menclose_top_bottom() -> Result<()> { + let expr = " + 32 + "; + test("hu", "SimpleSpeak", expr, "vonal felső, alsó, kezdet: 3 ketted végpont vége")?; + return Ok(()); + +} diff --git a/tests/Languages/hu/SimpleSpeak/mroot.rs b/tests/Languages/hu/SimpleSpeak/mroot.rs new file mode 100644 index 000000000..225e191c0 --- /dev/null +++ b/tests/Languages/hu/SimpleSpeak/mroot.rs @@ -0,0 +1,178 @@ +use crate::common::*; +use anyhow::Result; + +// AI generated +#[test] +fn msqrt_simple() -> Result<()> { + let expr = " + x + "; + test("hu", "SimpleSpeak", expr, "a négyzetgyöke ennek: x")?; + return Ok(()); + +} + +// AI generated +#[test] +fn msqrt_simple_end_root() -> Result<()> { + let expr = " + x + "; + test_ClearSpeak("hu", "ClearSpeak_Roots", "RootEnd", expr, "négyzetgyök x, gyök vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn msqrt_simple_positive() -> Result<()> { + let expr = " + x + "; + test_ClearSpeak("hu", "ClearSpeak_Roots", "PosNegSqRoot", expr, "pozitív négyzetgyök x")?; + return Ok(()); + +} + +// AI generated +#[test] +fn msqrt_simple_pos_end_root() -> Result<()> { + let expr = " + x + "; + test_ClearSpeak("hu", "ClearSpeak_Roots", "PosNegSqRootEnd", expr, "pozitív négyzetgyök x, gyök vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn msqrt_simple_pos_end_with_neg_root() -> Result<()> { + let expr = " + - x + - x 3 + "; + test_ClearSpeak("hu", "ClearSpeak_Roots", "PosNegSqRootEnd", expr, + "negatív négyzetgyök x, gyök vége; mínusz, a pozitív köbgyök x, gyök vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn mroot_simple_pos_end_with_neg_root() -> Result<()> { + let expr = " + - x 3 + - x + + "; + test_ClearSpeak("hu", "ClearSpeak_Roots", "PosNegSqRoot", expr, + "a negatív köbgyök x; mínusz pozitív négyzetgyök x")?; + return Ok(()); + +} + +// AI generated +#[test] +fn neg_without_root() -> Result<()> { + let expr = " + - x - y + "; + test("hu", "ClearSpeak", expr, "negatív x mínusz y")?; + return Ok(()); + +} + +// AI generated +#[test] +fn msqrt() -> Result<()> { + let expr = " + + x + y + + "; + test("hu", "ClearSpeak", expr, "négyzetgyök x plusz y")?; + return Ok(()); + +} + +// AI generated +#[test] +fn mroot_as_square_root() -> Result<()> { + let expr = " + x 2 + "; + test("hu", "ClearSpeak", expr, "négyzetgyök x")?; + return Ok(()); + +} + +// AI generated +#[test] +fn cube_root() -> Result<()> { + let expr = " + x 3 + "; + test("hu", "ClearSpeak", expr, "a köbgyök x")?; + return Ok(()); + +} + +// AI generated +#[test] +fn ordinal_root() -> Result<()> { + let expr = " + x 9 + "; + test("hu", "ClearSpeak", expr, "a kilencedik gyök x")?; + return Ok(()); + +} + +// AI generated +#[test] +fn simple_mi_root() -> Result<()> { + let expr = " + x n + "; + test("hu", "ClearSpeak", expr, "a n-edik gyök x")?; + return Ok(()); + +} + +// AI generated +#[test] +fn mroot_simple_pos_end_root() -> Result<()> { + let expr = " + x t + "; + test_ClearSpeak("hu", "ClearSpeak_Roots", "PosNegSqRootEnd", expr, "a pozitív t-edik gyök x, gyök vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn mroot_simple_end_root() -> Result<()> { + let expr = " + x + y + 21 + "; + test_ClearSpeak("hu", "ClearSpeak_Roots", "RootEnd", expr, "a huszonegyedik gyök x plusz y, gyök vége")?; + return Ok(()); + +} + +// AI generated +#[test] +fn simple_fraction_power() -> Result<()> { + let expr = " + + x + 13 + + "; + test("hu", "ClearSpeak", expr, "a 1 harmad gyök x")?; + return Ok(()); + +} diff --git a/tests/Languages/hu/definitions.rs b/tests/Languages/hu/definitions.rs new file mode 100644 index 000000000..bd84fb155 --- /dev/null +++ b/tests/Languages/hu/definitions.rs @@ -0,0 +1,1026 @@ +/// Tests for rules in definitions: +/// * modified var +use crate::common::*; +use anyhow::Result; + +#[test] +fn tuple_basic() -> Result<()> { + // function + let expr = r#" + + + x + y + + + "#; + + test("hu", "ClearSpeak", expr, "a tuple x vessző, y")?; + test("hu", "SimpleSpeak", expr, "a tuple x vessző, y")?; + + return Ok(()); +} + +#[test] +fn my_set_basic() -> Result<()> { + let expr = r#" + + + x + y + + + "#; + + test("hu", "ClearSpeak", expr, "az üres halmaz")?; + + Ok(()) +} + +#[test] +fn fixed_test() -> Result<()> { + let expr = r#" + + az összes valós szám halmaza + + + "#; + + test("hu", "ClearSpeak", expr, "az összes valós szám halmaza")?; + Ok(()) +} + +#[test] +fn i_test() -> Result<()> { + let expr = r#" + + képzeletbeli én + + + "#; + + test("hu", "ClearSpeak", expr, "képzeletbeli én")?; + Ok(()) +} + + +#[test] +fn floor_basic() -> Result<()> { + let expr = r#" + + + x + + + "#; + + test("hu", "ClearSpeak", expr, "lépcső x")?; + + Ok(()) +} + +#[test] +fn set_difference_basic() -> Result<()> { + let expr = r#" + + + A + + B + + + "#; + + test( "hu", "ClearSpeak", expr, "különbséghalmaz nagy a vessző, nagy b")?; + + Ok(()) +} + +#[test] +fn postfix_test() -> Result<()> { + let tests = [ + ( + "transpose", + r#" + + x + T + + "#, + "transzponált x", + ), + ( + "highlight", + r#" + + x + + "#, + "x kiemelt", + ), + ]; + + // Loop through all test cases, name _, body, and expected result + for (_, body, expected) in tests { + let expr = format!( + r#" + + {} + + "#, + body + ); + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + +#[test] +fn prefix_test() -> Result<()> { + // Prefix test limit, unit-vector, line-segment + // Directed-line-segment, line, ray, arc + let tests = [ + ( + "limit", + r#" + + x + + "#, + "határérték x", + ), + ( + "unit-vector", + r#" + + x + ^ + + "#, + "egységvektor x", + ), + ( + "line-segment", + r#" + + x + ¯ + + "#, + "line segment x", + ), + ]; + + for (_, body, expected) in tests { + let expr = format!( + r#" + + {} + + "#, + body + ); + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + + +#[test] +fn functions_and_inverses_tests() -> Result<()> { + let tests = vec![ + ("closed-interval", "x től y ig terjedő intervallum, tartalmazza a(z) x elemet és y elemet"), + ("closed-open-interval", "x től y ig terjedő intervallum, tartalmazza a(z) x elemet de nem tartalmazza a(z) y elemet"), + ("open-closed-interval", "x től y ig terjedő intervallum, nem tartalmazza a(z) x elemet de tartalmazza a(z) y elemet"), + ("open-interval", "x től y ig terjedő intervallum, nem tartalmazza a(z) x elemet vagy y elemet"), + + ("inverse", "inverz x"), + ("domain", "domén x"), + ("codomain", "kodomán x"), + ("image", "kép x"), + + //("fraction", "fraction x over y end fraction"), + ("mixed-fraction", "x és y"), + ("quotient", "egész rész osztva x vessző, y"), + ("evaluated-at", "x értékelve y"), + ("remainder", "a maradék, osztva x vessző, y"), + + ("max", "max x vessző, y vessző, z"), + ("min", "min x vessző, y vessző, z"), + + ("power", "x a(z) y-edik hatványon"), + + //("root", "gyök x"), + + ("greatest-common-divisor", "a legnagyobb közös osztó x vessző, y vessző, z"), + ("least-common-multiple", "a legkisebb közös többszörös x vessző, y vessző, z"), + + ("absolute-value", "x abszolút értéke"), + + ("complex-conjugate", "Komplex konjugált x"), + ("complex-arg", "argumentum x"), + ("real-part", "valós rész"), + ("imaginary-part", "képzetes rész"), + + ("polar-coordinate", "poláris koordináta x vessző, y"), + ("spherical-coordinate", "gömb koordináta x vessző, y vessző, z"), + ("cartesian-coordinate", "derékszögű koordináta x vessző, y vessző, z"), + ("coordinate", "pont, x vessző y vessző z"), + + ("floor", "lépcső x"), + ("ceiling", "mennyezet x"), + ("round", "kerekített érték x"), + ("fractional-part", "tört rész x"), + + + ]; + + for (intent, expected) in tests { + let expr = match intent { + + "max" + | "min" + | "greatest-common-divisor" + | "least-common-multiple" + | "spherical-coordinate" + | "cartesian-coordinate" + | "coordinate" => { + format!( + " + + x + y + z + + ", + intent + ) + } + + "power" + | "mixed-fraction" + | "quotient" + | "evaluated-at" + | "remainder" + | "closed-interval" + | "closed-open-interval" + | "open-closed-interval" + | "open-interval" + | "polar-coordinate" => { + format!( + " + + x + y + + ", + intent + ) + } + + _ => { + format!( + " + + x + + ", + intent + ) + } + }; + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + + +#[test] +fn calculus_tests() -> Result<()> { + let tests = vec![ + //("derivative", "the derivative of x with respect to x"), + //"definite-integral", "integral over x from x to x"), + + // prefix + ("limit", "határérték x"), + + // infix + ("tends-to", "x ehhez tart y"), + ("tends-to-from-above", "x általában alulról indul y"), + ("tends-to-from-below", "x alulról indul y"), + ]; + + for (intent, expected) in tests { + let expr = match intent { + "limit" => { + format!( + " + + x + + ", + intent + ) + } + + _ => { + // infix cases + format!( + " + + x + y + + ", + intent + ) + } + }; + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + + +#[test] +fn set_tests() -> Result<()> { + let tests = vec![ + ("set", "a halmaz x"), + //("set-difference", "x és y halmaz különbsége"), + ("complement", "komplemens x"), + //("empty-set", "üres halmaz"), + ("cardinality", "számosság x"), + ("list", "lista x"), + ("tuple", "a tuple x"), + ]; + + for (intent, expected) in tests { + let expr = format!( + " + + x + + ", + intent + ); + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + + +#[test] +fn sequence_and_series_intents() -> Result<()> { + let tests = [ + ( + "sum-1", + r#" + + + x + + "#, + "összeg x", + ), + ( + "sum-2", + r#" + + + i + x + + "#, + "összeg i vessző, x", + ), + ( + "sum-3", + r#" + + + i + n + x + + "#, + "összeg i vessző, n vessző, x", + ), + ( + "product-1", + r#" + + + x + + "#, + "szorzat x", + ), + ( + "product-2", + r#" + + + i + x + + "#, + "szorzat i vessző, x", + ), + ( + "product-3", + r#" + + + i + n + x + + "#, + "szorzat i vessző, n vessző, x", + ), + ]; + + for (_, body, expected) in tests { + let expr = format!( + r#" + + {} + + "#, + body + ); + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + +#[test] +fn elementary_classical_tests() -> Result<()> { + let tests = vec![ + // Trig + ("sine", "szinusz x"), + ("cosine", "koszinusz x"), + ("tangent", "tangens x"), + ("secant", "szekáns x"), + ("cosecant", "koszekáns x"), + ("cotangent", "kotangens x"), + + // Inverse trig + ("arcsine", "arkusz szinusz x"), + ("arccosine", "arkusz koszinusz x"), + ("arctangent", "arkusz tangens x"), + ("arcsecant", "arkusz szekáns x"), + ("arccosecant", "arkusz koszekáns x"), + ("arccotangent", "arkusz kotangens x"), + + // Hyperbolic trig + ("hyperbolic-sine", "hiperbolikus szinusz x"), + ("hyperbolic-cosine", "hiperbolikus koszinusz x"), + ("hyperbolic-tangent", "hiperbolikus tangens x"), + ("hyperbolic-secant", "hiperbolikus szekáns x"), + ("hyperbolic-cosecant", "hiperbolikus koszekáns x"), + ("hyperbolic-cotangent", "hiperbolikus kotangens x"), + + // Inverse hyperbolic trig + ("arc-hyperbolic-sine", "arkusz hiperbolikus szinusz x"), + ("arc-hyperbolic-cosine", "arkusz hiperbolikus koszinusz x"), + ("arc-hyperbolic-tangent", "arkusz hiperbolikus tangens x"), + ("arc-hyperbolic-secant", "arkusz hiperbolikus szekáns x"), + ("arc-hyperbolic-cosecant", "arkusz hiperbolikus koszekáns x"), + ("arc-hyperbolic-cotangent", "arkusz hiperbolikus kotangens x"), + ]; + + for (intent, expected) in tests { + let expr = format!( + " + + x + + ", + intent + ); + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + +#[test] +fn statistics_and_probability_tests() -> Result<()> { + let tests = vec![ + ("mean", "jelentése x"), + ("standard-deviation", "szórás x"), + ("variance", "variencia x"), + ("median", "medián x"), + ("mode", "mód x"), + + // conditional probability typically two arguments + // ("conditional-probability", "probability of x given y"), + ]; + + for (intent, expected) in tests { + let expr = match intent { + "conditional-probability" => format!( + " + + P + ( + + x + | + y + + ) + + ", + intent + ), + _ => format!( + " + + x + + ", + intent + ), + }; + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + +#[test] +fn linear_algebra_tests() -> Result<()> { + let tests = vec![ + ("vector", "vektor x"), + // ("matrix", "matrix of x"), + ("determinant", "determináns a x"), + ("adjugate", "adjugált x"), + ("magnitude", "nagyságrend x"), + ("norm", "normalizálás x"), + ("span", "fesztávolság x"), + + // transpose supports both postfix and function; we test function explicitly + ("transpose", "transzponált x"), + + // dimensional product is infix + ("dimensional-product", "x a(z) y"), + + // unit-vector is prefix + ("unit-vector", "egységvektor x") + ]; + + for (intent, expected) in tests { + let expr: String = match intent { + "dimensional-product" => { + " + + x + y + + " + .to_string() + } + _ => format!( + " + + x + + " + ), + }; + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + +#[test] +fn nofix_set_tests() -> Result<()> { + let tests = vec![ + ("set-of-integers", "ℤ", "az összes egész szám halmaza"), + ("set-of-reals", "valós számok halmaza", "az összes valós szám halmaza"), + ("set-of-rationals", "ℚ", "az összes racionális szám halmaza"), + ("set-of-natural-numbers", "ℕ", "az összes természetes szám halmaza"), + ("set-of-complex-numbers", "ℂ", "az összes komplex szám halmaza"), + ("set-of-primes", "ℙ", "az összes prímszám halmaza"), + ]; + + for (intent, symbol, expected) in tests { + let expr = format!( + " + {} + ", + intent, + symbol + ); + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + +#[test] +fn geometry_prefix_multi_value_tests() -> Result<()> { + let tests = vec![ + ("line-segment", "vonalszakasz x y"), + ("directed-line-segment", "irányított vonalszakasz x y"), + ("line", "vonal x y"), + ("ray", "sugár x y"), + ("arc", "ív x y"), + ("point", "pont x y z"), + ]; + + for (intent, expected) in tests { + let expr = match intent{ + "point" => { + format!( + " + + x + y + z + + " + ) + } + + _ => { + format!( + " + + x + y + + " + ) + } + }; + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + +#[test] +fn geometry_prefix_tests() -> Result<()> { + let tests = vec![ + ("length", "hossz x"), + ("area", "terület x"), + ("volume", "hangerő x"), + ]; + + for (intent, expected) in tests { + let expr = format!( + " + + x + + " + ); + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + +#[test] +fn separator_tests() -> Result<()> { + let expr = format!( + " + + x + y + + " + ); + + test("hu", "ClearSpeak", &expr, "x y")?; + Ok(()) +} + +#[test] +fn general_concepts_tests() -> Result<()> { + let tests = vec![ + // Unary structural + ("fenced-group", "bekerített csoport x"), + ("highlight", "x kiemelt"), + ("least-common-denominator", "legkisebb közös nevező x vessző, y vessző, z"), // add x, y , z ... + ("pochhammer", "permutáció x"), + ("permutation-cycle", "permutációs ciklus x"), + + // Binary structural / infix-style + // ("ordered-pair", "the pair of x and y"), + ("rate", "x per y"), + + ("binomial-coefficient", "x választ y"), + ("embellished-name", "x megjegyzéssel y"), + ("indexed-by", "x alsó index y"), + // ("translation", "translation by x comma, y"), // Changes translation to comma + ("constraint", "x feltétellel y"), + ]; + + for (intent, expected) in tests { + let expr = match intent { + "ordered-pair" + | "rate" + | "constraint" + | "binomial-coefficient" + | "embellished-name" + | "translation" + | "indexed-by" => { + format!( + " + + x + y + + ", + intent + ) + } + "least-common-denominator" => { + format!( + " + + x + y + z + + ", + intent + ) + } + + // unary cases + _ => { + format!( + " + + x + + ", + intent + ) + } + }; + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + +#[test] +fn grouping_tests() -> Result<()> { + let tests = vec![ +("annotation", "x ami y"), + // ("braced-group", "grouped x end-grouped"), + // ("repeating-decimal", "repeating decimal of x"), + ]; + + for (intent, expected) in tests { + let expr = match intent { + "annotation" => { + format!( + " + + x + y + + ", + intent + ) + } + _ => { + format!( + " + + x + + ", + intent + ) + } + }; + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + +#[test] +fn function_default_fixity_tests() -> Result<()> { + let tests = vec![ + ("curl", "rotáció x"), + ("divergence", "eltérés x"), + ("gradient", "gradiens x"), + ("laplacian", "laplaciánus x"), + ]; + + for (intent, expected) in tests { + let expr = format!( + " + + x + + ", + intent + ); + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + +#[test] +fn prefix_default_fixity_tests() -> Result<()> { + let tests = vec![ + ("angle", "szög x"), + ("angle-measure", "szögmérés x"), + ("change", "változás x"), + ("for-all", "minden x"), + ("measured-angle", "mért szög x"), + ("not", "nem x"), + ("number-of", "száma x"), + ("partial-derivative", "parciális derivált x"), + ("right-angle", "derékszög x"), + ("square-root-of", "négyzetgyöke x"), + ("there-does-not-exist", "nem létezik x"), + ("there-exists", "létezik x"), + ]; + + for (intent, expected) in tests { + let expr = format!( + " + + x + + ", + intent + ); + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + +#[test] +fn infix_default_fixity_tests() -> Result<()> { + let tests = vec![ + ("and", "x és y"), + ("applied-to", "x alkalmazva y"), + ("approximately", "x hozzávetőlegesen y"), + ("congruent", "x egybeesik y"), + ("cartesian-product", "x derékszögű szorzat y"), + ("composed-with", "x komponálva y"), + ("cross-product", "x kereszt szorzata y"), + ("defined-as", "x definiálva y"), + ("divided-by", "x osztva y"), + ("divides", "x osztja y"), + ("does-not-belong-to", "x nem tartozik hozzá y"), + ("does-not-divide", "x nem osztja y"), + ("dot-product", "x skaláris szorzat y"), + ("downwards-diagonal-ellipsis", "x lefelé mutató átlós ellipszis y"), + ("direct-product", "x direkt szorzat y"), + ("element-of", "x eleme y"), + ("ellipsis", "x ellipszis y"), + ("equals", "x egyenlő y"), + ("equivalent-to", "x egyenértékű ezzel y"), + ("evaluates-to", "x értéke y"), + ("given", "x adott y"), + ("greater-than", "x nagyobb, mint y"), + ("greater-than-or-equal-to", "x nagyobb vagy egyenlő, mint y"), + ("identically-equals", "x teljesen egyenlő y"), + ("if-and-only-if", "x akkor és csak akkor, ha y"), + ("implies", "x utal y"), + ("inner-product", "x belső szorzat y"), + ("intersection", "x keresztezi y"), + ("less-than", "x kisebb, mint y"), + ("less-than-or-equal-to", "x kisebb vagy egyenlő, mint y"), + ("list-separator", "x vessző y"), + ("maps-to", "x megfelel ennek y"), + ("member-of", "x tagja y"), + ("minus", "x mínusz y"), + ("minus-or-plus", "x mínusz vagy plusz y"), + ("not-subset", "x nem részhalmaza y"), + ("not-superset", "x nem szuperhalmaza y"), + ("not-equal-to", "x nem egyenlő y"), + ("not-member-of", "x nem tagja y"), + ("not-parallel-to", "x nem párhuzamos y"), + ("obtained-from", "x innen származik y"), + ("or", "x vagy y"), + ("outer-product", "x külső szorzata y"), + ("parallel-to", "x párhuzamos y"), + ("perpendicular", "x merőleges y"), + ("plus", "x plusz y"), + ("plus-or-minus", "x plusz vagy mínusz y"), + ("precedes", "x megelőzi y"), + ("proportional", "x arányos y"), + ("range-separator", "x keresztül y"), + ("ratio", "x arány y"), + ("similar", "x hasonló y"), + ("subset", "x részhalmaza y"), + ("subset-or-equal", "x részhalmaza vagy egyenlő y"), + ("succeeds", "x követi y"), + ("such-that", "x úgy, hogy y"), + ("superset", "x szuperhalmaza y"), + ("superset-or-equal", "x szuperhalmaza vagy egyenlő y"), + ("tilde", "x tilde y"), + ("times", "x szorozva y"), + ("union", "x unió y"), + ("upwards-diagonal-ellipsis", "x felfelé átlós ellipszis y"), + ("vertical-ellipsis", "x függőleges ellipszis y"), + ("xor", "x kizárólagos vagy y"), + ]; + + for (intent, expected) in tests { + let expr = format!( + " + + x + y + + ", + intent + ); + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + +#[test] +fn postfix_default_fixity_tests() -> Result<()> { + let tests = vec![ + ("factorial", "x faktoriális"), + ("percent", "x százalék"), + ]; + + for (intent, expected) in tests { + let expr = format!( + " + + x + + ", + intent + ); + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} + +#[test] +fn nofix_default_fixity_tests() -> Result<()> { + let tests = vec![ + ("diameter", "átmérő", "átmérő"), + ("distance", "távolság", "távolság"), + ("probability", "valószínűség", "valószínűség"), + ("radius", "sugár", "sugár"), + ("volume", "hangerő", "hangerő"), + ("exponential-e", "e", "e"), + ("imaginary-i", "képzeletbeli én", "képzeletbeli én"), + ("differential-d", "d", "d"), + ("golden-ratio", "φ", "aranymetszés"), + ]; + + for (intent, symbol, expected) in tests { + let expr = format!( + " + {} + ", + intent, + symbol + ); + + test("hu", "ClearSpeak", &expr, expected)?; + } + + Ok(()) +} diff --git a/tests/Languages/hu/shared.rs b/tests/Languages/hu/shared.rs index a97805f8a..bd53bb4c3 100644 --- a/tests/Languages/hu/shared.rs +++ b/tests/Languages/hu/shared.rs @@ -381,7 +381,7 @@ fn bug_199_2pi() -> Result<()> { ) "; - test("hu", "SimpleSpeak",expr, "0 től 2 pí ig terjedő intervallum, tartalmazza a 0 elemet de nem tartalmazza a 2 pí elemet")?; + test("hu", "SimpleSpeak",expr, "0 től 2 pí ig terjedő intervallum, tartalmazza a(z) 0 elemet de nem tartalmazza a(z) 2 pí elemet")?; return Ok(()); } From 67cf927541763cf278f6ab794961dc02e1d1adec Mon Sep 17 00:00:00 2001 From: nsoiffer Date: Fri, 14 Aug 2026 23:44:23 -0700 Subject: [PATCH 2/4] Apply Hungarian unicode fixes from PR #673 --- Rules/Languages/hu/unicode-full.yaml | 21 ++++++++++----------- Rules/Languages/hu/unicode.yaml | 5 ----- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Rules/Languages/hu/unicode-full.yaml b/Rules/Languages/hu/unicode-full.yaml index 2926422e0..4ab669c7a 100644 --- a/Rules/Languages/hu/unicode-full.yaml +++ b/Rules/Languages/hu/unicode-full.yaml @@ -273,7 +273,7 @@ - "‱": [T: "per tízezer"] # 0x2031 (en: 'per ten thousand', DeepL translation) - "′": [T: "prím"] # 0x2032 (en: 'prime', DeepL translation) - "″": [T: "dupla prím"] # 0x2033 (en: 'double prime', DeepL translation) - - "‴": [T: "hármas ikerprím"] # 0x2034 (en: 'triple prime', DeepL translation) + - "‴": [T: "hármas prím"] # 0x2034 (en: 'triple prime', DeepL translation) - "‵": [T: "fordított prím"] # 0x2035 (en: 'reversed prime', DeepL translation) - "‶": [T: "fordított dupla prím"] # 0x2036 (en: 'reversed double prime', DeepL translation) - "‷": [T: "fordított hármas prím"] # 0x2037 (en: 'reversed triple prime', DeepL translation) @@ -951,11 +951,6 @@ - "⊢": [T: "bizonyítja"] # 0x22a2 (en: 'proves', DeepL translation) - "⊣": [T: "nem enged"] # 0x22a3 (en: 'does not yield', DeepL translation) - "⊤": [T: "felső"] # 0x22a4 (en: 'top', DeepL translation) - - "⊥": # 0x22a5 - - test: - if: "$Verbosity!='Terse'" - then: [T: "a(z)"] # (en: 'is', DeepL translation) - - T: "alul" # (en: 'bottom', DeepL translation) - "⊦": [T: "redukálódik"] # 0x22a6 (en: 'reduces to', DeepL translation) - "⊧": [T: "modellezi"] # 0x22a7 (en: 'models', DeepL translation) - "⊨": # 0x22a8 @@ -1543,11 +1538,15 @@ - "➾": [T: "nyitott körvonalú jobbra mutató nyíl"] # 0x27be (en: 'open-outlined right arrow', DeepL translation) - "⟀": [T: "háromdimenziós szög"] # 0x27c0 (en: 'three dimensional angle', DeepL translation) - "⟁": [T: "fehér háromszög, benne egy kis fehér háromszög"] # 0x27c1 (en: 'white triangle containing small white triangle', DeepL translation) - - "⟂": # 0x27c2 - - test: - if: "$Verbosity!='Terse'" - then: [T: "a(z)"] # (en: 'is', DeepL translation) - - T: "merőleges" # (en: 'perpendicular to', DeepL translation) + - "⟂⊥": # 0x27c2, 22A5 (22A5 wrongly used for perpendicular by most editors) + - test: + - if: "$SpeechStyle = 'LiteralSpeak' and text()='⊥'" # 22A5 (up tack/bottom) + then: [T: "felfelé mutató merőleges"] + - else: + - test: + if: "$Verbosity!='Terse'" + then: [T: "a(z)"] + - T: "merőleges" - "⟃": # 0x27c3 - test: if: "$Verbosity!='Terse'" diff --git a/Rules/Languages/hu/unicode.yaml b/Rules/Languages/hu/unicode.yaml index 41f8263f2..16561b733 100644 --- a/Rules/Languages/hu/unicode.yaml +++ b/Rules/Languages/hu/unicode.yaml @@ -297,7 +297,6 @@ - "⁢": [T: ""] # 0x2062 - "⁣": [T: "láthatatlan elválasztó"] # 0x2063 - "⁤": [T: "és"] # 0x2064 (en: 'and', DeepL translation) - - "‴": [T: "hármas prím"] # 0x2034 (en: 'triple prime', DeepL translation) - "ℂℕℚℝℤ": # here we rely on this running through the table again to speak "cap xxx" - T: "duplán leütött" # (en: 'double-struck', DeepL translation) @@ -418,7 +417,6 @@ then: [T: "benne van ebben:"] # (en: 'is in', DeepL translation) - else: [T: "ebbe a halmazba tartozik:"] # $ClearSpeak_SetMemberSymbol = 'Belongs' (en: 'belongs to', DeepL translation) - "∐": [T: "diszjunkt unió"] # 0x2210 (en: 'co-product', DeepL translation) - - "∗": [T: "csillag operátortimes"] # 0x2217 (DeepL translation) - "√": # 0x221a - test: if: "$Verbosity!='Terse'" @@ -448,7 +446,6 @@ if: "$Verbosity!='Terse'" then: [T: "van"] # (en: 'is', DeepL translation) - T: "hogy" # (DeepL translation) - - "∷": [T: "arány"] # 0x2237 (DeepL translation) - "∾": # 0x223e - test: if: "$Verbosity!='Terse'" @@ -474,8 +471,6 @@ if: "$Verbosity!='Terse'" then: [T: ""] # (en: 'is', DeepL translation) - T: "nagyobb vagy egyenlő" # (en: 'greater than or equal to', DeepL translation) - - "≦": [T: "kisebb, mint egyenlő"] # 0x2266 (en: 'less than over equal to', DeepL translation) - - "≧": [T: "nagyobb, mint az egyenlő"] # 0x2267 (en: 'greater than over equal to', DeepL translation) - "⊂": # 0x2282 - test: if: "$Verbosity!='Terse'" From 2b6c804646958b8da97d626ac7baddbfcf5d5351 Mon Sep 17 00:00:00 2001 From: nsoiffer Date: Sun, 16 Aug 2026 16:30:21 -0700 Subject: [PATCH 3/4] Update Hungarian language and test rules from PR #694 --- Rules/Languages/hu/ClearSpeak_Rules.yaml | 18 +- Rules/Languages/hu/SharedRules/default.yaml | 71 +++--- Rules/Languages/hu/SharedRules/general.yaml | 4 +- Rules/Languages/hu/SharedRules/geometry.yaml | 3 +- Rules/Languages/hu/definitions.yaml | 94 ++++++-- Rules/Languages/hu/navigate.yaml | 57 +++-- Rules/Languages/hu/unicode-full.yaml | 207 +++++++++++++++++- tests/Languages/hu/ClearSpeak/sets.rs | 18 +- .../hu/ClearSpeak/symbols_and_adornments.rs | 8 +- tests/Languages/hu/definitions.rs | 32 ++- tests/Languages/hu/shared.rs | 9 +- 11 files changed, 401 insertions(+), 120 deletions(-) diff --git a/Rules/Languages/hu/ClearSpeak_Rules.yaml b/Rules/Languages/hu/ClearSpeak_Rules.yaml index 73d8eaf5e..434034698 100644 --- a/Rules/Languages/hu/ClearSpeak_Rules.yaml +++ b/Rules/Languages/hu/ClearSpeak_Rules.yaml @@ -568,27 +568,25 @@ - name: set tag: set - match: "." + # Empty set and braced/{set-builder} forms (typically 0–1 child). + # Multi-arg intent set($x,$y,...) and set($x) with @arg fall through to function-intent + # ("the set of …"). + match: "count(*)=0 or (count(*)=1 and not(*[1][@arg]))" replace: - test: - if: "count(*)=0" then: [T: "az üres halmaz"] # phrase('the empty set') - - else_if: "count(*)=2" - then: - - test: - if: "$Verbosity!='Terse'" - then: [T: "az"] # phrase('the' empty set) - - T: "üres halmaz" # phrase(the 'empty set') - else_if: "count(*[1]/*)=3 and *[1]/*[2][self::m:mo][.=':' or .='|' or .='∣']" then: - test: if: "$Verbosity!='Terse'" - then: [T: ""] # phrase('the' set of all integers) - - x: "*[1]/*[1]" - - T: "melyekre teljesül, hogy" # phrase(this is a 'set of' numbers) + then: [T: ""] # phrase('the' empty set) + - T: "" # phrase(the 'empty set') - test: if: "$ClearSpeak_Sets != 'woAll'" then: [T: "minden"] # phrase(the set of 'all' integers) + - x: "*[1]/*[1]" + - T: "melyekre teljesül, hogy" # phrase(the set S 'such that' x is less than y) - x: "*[1]/*[3]" else: - test: diff --git a/Rules/Languages/hu/SharedRules/default.yaml b/Rules/Languages/hu/SharedRules/default.yaml index b218667df..54bbffc64 100644 --- a/Rules/Languages/hu/SharedRules/default.yaml +++ b/Rules/Languages/hu/SharedRules/default.yaml @@ -62,7 +62,7 @@ - test: - if: "string-length(.) = 1 and text() != '_'" # need unicode.tdl to kick in for single letter tokens then: [x: "text()"] - - else_if: "@data-chem-element > 0 or @data-roman-numeral" # NavMode=Character needs this + - else_if: "@data-chem-element or @data-roman-numeral" # NavMode=Character needs this then: [SPELL: "text()", pause: "short"] else: [x: "translate(., '-_\u00A0', ' ')"] # from intent literals or from extra spaces added (which get deleted) @@ -237,26 +237,12 @@ - x: "*[2]" - T: "alatt" # phrase(x with z 'below' it) -# FIX: this only works for up to four dots (which is realistically all we need) -- name: dot-over - tag: modified-variable - match: "*[1][self::m:mi] and (*[2][translate(., '.', '')=''])" - replace: - - x: "*[1]" - - x: "IfThenElse(string-length(*[2])=1, 'pont', - IfThenElse(string-length(*[2])=2, 'pont pont', - IfThenElse(string-length(*[2])=3, 'pont pont pont', 'pont pont pont pont') - ))" - - pause: short - -# FIX: the 'translate' list is a little different from 'modified-variable', so we also include 'mover' (unify?) - name: diacriticals - tag: [mover, modified-variable] + tag: mover match: "*[1][self::m:mi] and *[2][translate(., '\u0306\u030c.\u00A8\u02D9\u20DB\u20DC`^ˇ~→¯_', '')='']" replace: - x: "*[1]" - x: "*[2]" - - pause: short - name: default tag: mover @@ -434,23 +420,22 @@ - T: "szkriptek vége" # phrase(At this point 'end scripts' occurs) - name: default - tag: [mtable, array] + tag: mtable variables: - IsColumnSilent: "false()" - - NumColumns: "CountTableColumns(.)" - - NumRows: "CountTableRows(.)" + - NumColumns: "count(*[1]/*) - IfThenElse(*/self::m:mlabeledtr, 1, 0)" match: "." replace: - T: "táblázat" # phrase(the 'table with' 3 rows) - - x: "$NumRows" + - x: count(*) - test: - if: "$NumRows=1" + if: count(*)=1 then: [T: "sorral"] # phrase(the table with 1 'row') else: [T: "sorral"] # phrase(the table with 3 'rows') - T: "és" # phrase(the table with 3 rows 'and' 4 columns) - x: "$NumColumns" - test: - if: "$NumColumns=1" + if: "NumColumns=1" then: [T: "oszloppal"] # phrase(the table with 3 rows and 1 'column') else: [T: "oszloppal"] # phrase(the table with 3 rows and 4 'columns') - pause: long @@ -491,6 +476,18 @@ - x: "count(preceding-sibling::*)+IfThenElse(parent::m:mlabeledtr, 0, 1)" - pause: medium - x: "*" + - test: + # short pause after each element; medium pause if last element in a row; long pause for last element in matrix + if: "HasVisibleColumnLine(../.., count(preceding-sibling::*) + 1)" + then: + - pause: short + - T: "elválasztó" + - test: + # Announce a row separator only after the row's final cell, so it is spoken once per horizontal boundary. + if: "count(following-sibling::*) = 0 and HasVisibleRowLine(../.., count(../preceding-sibling::*) + 1)" + then: + - pause: short + - T: "sorelválasztó" - test: # short pause after each element; medium pause if last element in a row; long pause for last element in matrix - if: count(following-sibling::*) > 0 @@ -500,6 +497,7 @@ else: [pause: long] + - name: empty-box # The ordering below is the order in which words come out when there is more than one value # Note: @notation can contain more than one value @@ -720,16 +718,27 @@ replace: - x: "SpeakIntentName(name(.), $Verbosity, 'function')" - test: - if: "$Verbosity != 'Terse' and not(contains(@data-intent-property, ':literal:')) and - not(count(*)=2 and (IsInDefinition(*[1], 'TrigFunctionNames') or IsInDefinition(name(.), 'TerseFunctionNames')) and IsNode(*[2], 'simple'))" - then: [T: "", pause: auto] # phrase(sine 'of' 5) - - insert: - nodes: "*" - replace: - - test: - if: "not(contains(@data-intent-property, ':literal:'))" - then: [x: "','"] + - if: "IntentFunctionUseArityPath(name(.), 'function', count(*))" + then: + - x: "IntentFunctionGlueBefore(name(.), 'function', 1, count(*))" - pause: auto + - insert: + nodes: "*" + replace: + - x: "IntentFunctionGlueBefore(name(.), 'function', $InsertIndex, count(*))" + - pause: auto + else: + - test: + if: "$Verbosity != 'Terse' and not(contains(@data-intent-property, ':literal:')) and + not(count(*)=2 and (IsInDefinition(*[1], 'TrigFunctionNames') or IsInDefinition(name(.), 'TerseFunctionNames')) and IsNode(*[2], 'simple'))" + then: [T: "", pause: auto] # phrase(sine 'of' 5) + - insert: + nodes: "*" + replace: + - test: + if: "not(contains(@data-intent-property, ':literal:'))" + then: [x: "IntentFunctionArgSeparator(name(.), 'function', count(*))"] + - pause: auto - test: # speak "end ..." if not bracketed or last child is not simple and not last node if: "$Impairment = 'Blindness' and not(*[last()][IsBracketed(., '', '') or IsNode(., 'simple')] )" diff --git a/Rules/Languages/hu/SharedRules/general.yaml b/Rules/Languages/hu/SharedRules/general.yaml index 0637bf6e2..9013205e2 100644 --- a/Rules/Languages/hu/SharedRules/general.yaml +++ b/Rules/Languages/hu/SharedRules/general.yaml @@ -70,14 +70,14 @@ - name: real-part tag: real-part - match: "." + match: "count(*)=0" replace: - bookmark: "@id" - T: "valós rész" # phrase('the real part' of a complex number does not include the imaginary part) - name: imaginary-part tag: imaginary-part - match: "." + match: "count(*)=0" replace: - bookmark: "@id" - T: "képzetes rész" # phrase('the imaginary part' is part of a complex number) diff --git a/Rules/Languages/hu/SharedRules/geometry.yaml b/Rules/Languages/hu/SharedRules/geometry.yaml index c23f22526..c5a0ac601 100644 --- a/Rules/Languages/hu/SharedRules/geometry.yaml +++ b/Rules/Languages/hu/SharedRules/geometry.yaml @@ -60,7 +60,8 @@ - name: coordinate tag: coordinate - match: "." +# Intent forms coordinate($x,...) use @arg and fall through to function-intent / IntentMappings + match: "not(*[@arg])" replace: - test: if: "$Verbosity='Verbose'" diff --git a/Rules/Languages/hu/definitions.yaml b/Rules/Languages/hu/definitions.yaml index bdc649424..be0fd395a 100644 --- a/Rules/Languages/hu/definitions.yaml +++ b/Rules/Languages/hu/definitions.yaml @@ -1,14 +1,71 @@ --- - include: "../../definitions.yaml" -# If an "intent" is used, the 'terse:medium:verbose' speech for the intent name is given here for a prefix||infix||postfix||function fixity -# If only one ":" is used, the first part is used for 'terse' and the second part is used for 'medium' and 'verbose' -# If no ":"s are used, the same speech is used for all forms -# If bracketing words make sense, they are separated with ";"s -# Intent mappings must specify whether they are "prefix", "infix", "postfix", or "function" with an "=" sign -# If there are multiple fixities (e.g., see transpose), they are separated with "||" -# for readability, spaces can be used around any of the delimiter characters -# Note: if there are multiple fixities, the first one is used if the fixity is not given in the intent +# IntentMappings Syntax: +# +# This section defines how each "intent" is spoken for various grammatical forms (fixities such as "prefix", "infix", "postfix", and "function"), +# along with supporting different verbosity levels. +# The syntax is a little bit complicated, but allows a declarative syntax so you don't have to write as many rules. +# +# For each intent, you specify spoken forms for one or more fixities using the syntax below. +# +# - Each mapping has the form: +# "": "= || = || ...", +# or just +# "": "", +# where is used for all forms if fixity and '=' are omitted. +# +# - If an intent has multiple fixities, separate them with "||". Spaces are allowed around delimiters for readability. +# - If only one ":" is present in **, it provides the 'terse' form, and the following string is used for both 'medium' and 'verbose'. +# - If more than one ":" is present, the string is split into 'terse', 'medium', and 'verbose' forms, in that order (each separated by ":"). +# - If no ":" is present, the same spoken form is used for all styles. +# +# - Use semicolons ";" to divide opening, main, and closing bracketing words within a speech string, where such words make sense. +# - If an intent has multiple fixities but a definition does not specify one, the first fixity listed is chosen by default. +# +# Functions and argument glue: +# - The "|" character delimits options describing how to glue arguments together when speaking function arguments. +# - Arity templates (multiple "|" options, or one option with ','-separated glue words): glue-word count +# implies arity; the final argument is preceded by "of". Example: "sum | over | from,to" +# - 1 arg: "sum of x" +# - 2 args: "sum over i of x" +# - 3 args: "sum from i to n of x" +# If no option matches the argument count, separators fall back to "comma". +# - Binary separator (exactly one "|" option, no commas in it): after "of", that word joins the two args. +# Example: "quotient": "function=integer part | divided by" → "integer part of x divided by y" +# If there are not exactly two args, separators fall back to "comma" (no real n-ary use of these words). +# +# BNF-like description: +# +# IntentMappingsEntry ::= ":" +# +# ::= ( "||" )* +# | +# +# ::= "=" +# +# ::= "prefix" | "infix" | "postfix" | "function" | "nofix" | "silent" +# +# ::= +# | "|" ( "|" )* +# +# ::= text +# # May use ":" to separate terse:medium:verbose forms. +# # May use ";" for bracketing (opening; main; closing). +# +# ::= text +# # One option, no commas: binary separator after "of" (e.g. "divided by"). +# # One option with "," or several "|" options: arity templates +# # (glue-word count = arg_count - 1; last arg preceded by "of"). +# # Unmatched arity (or binary glue with ≠2 args): fall back to "comma". +# +# ::= (applies to all fixities) +# +# Example: +# "absolute-value": "function= ; absolute value: the absolute value: the absolute value; end absolute value" +# "sum": "function=sum | over | from,to" +# "quotient": "function=integer part | divided by" +# - IntentMappings: { "indexed-by": "infix= alsó index kezdete; alsó index; alsó index vége: alsó index vége: alsó index vége", "say-super": "infix=felső index: felső index: felső index", # used with 'mo' for superscripts (e.g, "<") @@ -30,14 +87,14 @@ #"fraction":"function=fraction; over; end fraction", # NOTE: Fails "mixed-fraction":"infix=és", # NOTE: in website says function, but follow infix speech pattern. "greatest-common-divisor": "function=a legnagyobb közös osztó", - "quotient":"function=egész rész osztva", # NOTE: Logic somewhere here failing, becomes "divided by of x comma, y" instead of "integer part of x divided by y" + "quotient":"function=egész rész | osztva", # NOTE: Logic somewhere here failing, becomes "divided by of x comma, y" instead of "integer part of x divided by y" "evaluated-at":"infix=értékelve || postfix=értékként", - "remainder":"function=a maradék, osztva", + "remainder":"function=a maradék | osztva", "max":"function=max", "min":"function=min", "power":"infix=a hatványra", "root":"function=root", - "imaginary-part": "a képzeletbeli rész", + "imaginary-part": "function=a képzeletbeli rész: a képzeletbeli rész: a képzeletbeli rész", "least-common-multiple": "function=lcm: a legkisebb közös többszörös: a legkisebb közös többszörös", "complex-conjugate":"function=Komplex konjugált", "complex-arg":"function=argumentum", @@ -74,15 +131,15 @@ "tends-to-from-below":"infix=alulról indul", ### Sets "set": "function= ; halmaz: a halmaz", - "set-difference":"function=különbséghalmaz || infix=mínusz || postfix=különbséghalmaza", # NOTE: not tested + "set-difference":"function=különbséghalmaz | és || infix=mínusz", "complement":"function=komplemens", "empty-set":"function=üres halmaz", "cardinality":"function=számosság", # NOTE: does not have a defined speech template in website "list":"function=lista", "tuple": "function= ; tuple: a tuple", ### Sequence and Series - "sum":"function= ; összegzés : összeg ; ", #: sum over : sum from; to", - "product":"function=szorzat || function=szorzat vége || function=szorzat innen ide", + "sum": "function=összeg", + "product":"function=szorzat", ### Elementary classical functions "sine":"function=szinusz: szinusz", @@ -118,7 +175,7 @@ "variance":"function=variencia", "median":"function=medián", "mode":"function=mód", - "conditional-probability":"function=valószínűség; adott", # NOTE: Check test + "conditional-probability":"function=valószínűség", ### Linear Algebra @@ -133,7 +190,7 @@ "unit-vector":"prefix=egységvektor", "identity-matrix":"nofix=identitásmátrix", # NOTE: no function specified - "transpose":"function=transzponált || postfix=transzponált", # postfix needs testing + "transpose":"postfix=transzponált || function=transzponált", "dimensional-product":"infix=a(z)", # INFIX @@ -164,10 +221,11 @@ ### General Concepts "fenced-group":"function=bekerített csoport", # appears both under general concepts and grouping # NOTE: in site mentions "the pair x and y", due to being defined as function, needs the "of" keyword - "ordered-pair": "function= ; a pár; és", # Needs to be tested, test converts "and" to "comma," + "ordered-pair": "function=a pár | és", # Needs to be tested, test converts "and" to "comma," "highlight":"postfix=kiemelt", "least-common-denominator":"function=legkisebb közös nevező", "rate":"infix=per", + "translation":"function=fordítás", "constraint":"infix= ; feltétellel; ", "binomial-coefficient":"infix=választ", @@ -269,7 +327,7 @@ ## Default fixity nofix "diameter":"nofix=átmérő: átmérő", "distance":"nofix=távolság; távolság: távolság", - "probability":"nofix=P: valószínűség", + "probability":"nofix=P: valószínűség || function=valószínűség", "radius":"nofix=r: sugár", "volume":"nofix=hangerő: hangerő || function=hangerő", "exponential-e":"nofix=e", diff --git a/Rules/Languages/hu/navigate.yaml b/Rules/Languages/hu/navigate.yaml index ff4afb8bb..475e1f625 100644 --- a/Rules/Languages/hu/navigate.yaml +++ b/Rules/Languages/hu/navigate.yaml @@ -60,38 +60,40 @@ - pause: "medium" else: - test: + # CommandOffset is 1 + length of the English NavCommand stem (Zoom/Move/Read/Describe), + # not the spoken Prefix length — so translations can use a different Prefix word. - if: "starts-with($NavCommand, 'Zoom')" - then: [set_variables: [Prefix: "'zoom'"]] # phrase('zoom' in to see more details) + then: [set_variables: [Prefix: "'zoom'", CommandOffset: "5"]] # phrase('zoom' in to see more details) - else_if: "starts-with($NavCommand, 'Move')" - then: [set_variables: [Prefix: "'move'"]] # phrase('move' to next entry in table) + then: [set_variables: [Prefix: "'move'", CommandOffset: "5"]] # phrase('move' to next entry in table) - else_if: "starts-with($NavCommand, 'Read')" - then: [set_variables: [Prefix: "'read'"]] # phrase('read' to next entry in table) + then: [set_variables: [Prefix: "'read'", CommandOffset: "5"]] # phrase('read' to next entry in table) - else_if: "starts-with($NavCommand, 'Describe')" - then: [set_variables: [Prefix: "'describe'"]] # phrase('describe' to next entry in table) + then: [set_variables: [Prefix: "'describe'", CommandOffset: "9"]] # phrase('describe' to next entry in table) - test: if: "$Prefix != ''" then: - x: "$Prefix" - test: - - if: "substring($NavCommand, string-length($Prefix)+1) = 'In'" + - if: "substring($NavCommand, $CommandOffset) = 'In'" then: [T: "ban"] # phrase(zoom 'in' to see more details) - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'InAll'" + - else_if: "substring($NavCommand, $CommandOffset) = 'InAll'" # HACK: '\uF8FE' is used internally for the concatenation char by 'ct' -- this gets "ed" concatenated to "zoom" - then: [T: "Teljesen betáplálva"] # phrase(zoom 'out all of the way' to see more details) - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Out'" + then: [T: "Teljesen kinagyítva"] # phrase(zoom 'out all of the way' to see more details) + - else_if: "substring($NavCommand, $CommandOffset) = 'Out'" then: [T: "ki"] # phrase(zoom 'out' to see more details) - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'OutAll'" + - else_if: "substring($NavCommand, $CommandOffset) = 'OutAll'" # HACK: '\uF8FE' is used internally for the concatenation char by 'ct' -- this gets "ed" concatenated to "zoom" - then: [T: "teljes táblázat megjelenítése\uF8FEe ki egészen"] # phrase(zoom 'out all of the way' to see more details) - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Next'" + then: [T: "teljes táblázat kinagyítása"] # phrase(zoom 'out all of the way' to see more details) + - else_if: "substring($NavCommand, $CommandOffset) = 'Next'" then: [T: "jobbra"] # phrase(move to the 'right') - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Previous'" + - else_if: "substring($NavCommand, $CommandOffset) = 'Previous'" then: [T: "balra"] # phrase(move to the 'left') - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Current'" + - else_if: "substring($NavCommand, $CommandOffset) = 'Current'" then: [T: "jelenlegi"] # phrase(who is the 'current' president) - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'LineStart'" + - else_if: "substring($NavCommand, $CommandOffset) = 'LineStart'" then: [T: "a sor elejére"] # phrase(move 'to start of line') - - else_if: "substring($NavCommand, string-length($Prefix)+1) = 'LineEnd'" + - else_if: "substring($NavCommand, $CommandOffset) = 'LineEnd'" then: [T: "a sor végére"] # phrase(move 'to end of line') - pause: "medium" - set_variables: [MatchCounter: "$MatchCounter + 1"] @@ -103,6 +105,15 @@ (name(.)='mrow' or name(.) = 'mtr' or name(.) = 'mlabeledtr' or @data-from-mathml = 'mtable')" replace: [] +# Prefix/silent intents with no NavigationParts entry (e.g. unary minus, x-hat) +# should not announce "in"/"out of". +- name: into-or-out-of-prefix-or-silent-without-parts + tag: "*" + match: "$Move2D != '' and + (contains(@data-intent-property, ':prefix:') or contains(@data-intent-property, ':silent:')) and + GetNavigationPartName(name(.), count($Child2D/preceding-sibling::*)) = ''" + replace: [] + - name: into-or-out-of-mtr tag: [mtr, mlabeledtr] match: "$Move2D = 'in'" @@ -158,7 +169,21 @@ - else_if: "count(*) = 1" then_test: if: "$NavVerbosity = 'Verbose'" - then: [x: "translate(name(.), '-_', ' ')"] # e.g., "in absolute value" + then: # IntentMappings via SpeakIntentName; falls back to spaced intent name + - test: + - if: "contains(@data-intent-property, ':prefix:')" + then: [x: "SpeakIntentName(name(.), $Verbosity, 'prefix')"] + - else_if: "contains(@data-intent-property, ':postfix:')" + then: [x: "SpeakIntentName(name(.), $Verbosity, 'postfix')"] + - else_if: "contains(@data-intent-property, ':infix:')" + then: [x: "SpeakIntentName(name(.), $Verbosity, 'infix')"] + - else_if: "contains(@data-intent-property, ':function:')" + then: [x: "SpeakIntentName(name(.), $Verbosity, 'function')"] + - else_if: "contains(@data-intent-property, ':nofix:')" + then: [x: "SpeakIntentName(name(.), $Verbosity, 'nofix')"] + - else_if: "contains(@data-intent-property, ':silent:')" + then: [x: "SpeakIntentName(name(.), $Verbosity, 'silent')"] + - else: [x: "SpeakIntentName(name(.), $Verbosity, 'other')"] else: - T: "része" # phrase(the 'part' of the expression) - x: "count($Child2D/preceding-sibling::*) + 1" diff --git a/Rules/Languages/hu/unicode-full.yaml b/Rules/Languages/hu/unicode-full.yaml index 4ab669c7a..23381591d 100644 --- a/Rules/Languages/hu/unicode-full.yaml +++ b/Rules/Languages/hu/unicode-full.yaml @@ -1279,17 +1279,10 @@ - T: "zárójeles" # (en: 'parenthesized', DeepL translation) - SPELL: "translate('.', '⒜⒝⒞⒟⒠⒡⒢⒣⒤⒥⒦⒧⒨⒩⒪⒫⒬⒭⒮⒯⒰⒱⒲⒳⒴⒵', 'abcdefghijklmnopqrstuvwxyz')" - - "Ⓐ-Ⓩ": # 0x24b6 - 0x24cf - - T: "bekarikázott" - - SPELL: "translate('.', 'ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" - - "🅐-🅩": # 0x1f150 - 0x1f169 - T: "fekete körrel jelölt" # (en: 'black circled', DeepL translation) - SPELL: "translate('.', '🅐🅑🅒🅓🅔🅕🅖🅗🅘🅙🅚🅛🅜🅝🅞🅟🅠🅡🅢🅣🅤🅥🅦🅧🅨🅩', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" - - "ⓐ-ⓩ": # 0x24d0 - 0x24e9 - - T: "bekarikázott" # (en: 'circled', DeepL translation) - - SPELL: "translate('.', 'ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ', 'abcdefghijklmnopqrstuvwxyz')" - "⓪": [T: "bekarikázott nulla"] # 0x24ea (en: 'circled zero', DeepL translation) - "⓫": [T: "fekete kör alakú tizenegyes"] # 0x24eb (en: 'black circled eleven', DeepL translation) - "⓬": [T: "fekete bekarikázott tizenkettő"] # 0x24ec (en: 'black circled twelve', DeepL translation) @@ -3619,3 +3612,203 @@ - "\uE42C": [SPELL: "'←'"] # 0xe42c defer to def of arrow - "\uE42D": [SPELL: "'→'"] # 0xe42d defer to def of arrow - "\uE42E": [SPELL: "'⇄'"] # 0xe42e defer to def of arrow +# Following symbols hungarian translations are restored, because english unicode-full.yaml file again contains this symbols. +# Note: this restoration purpose only to audit translation tool doesn't show this difference with english unicode-full.yaml and hungarian unicode-full.yaml file. +# This symbols are defined too the hungarian unicode.yaml file. + - "¬": [T: "logikai nem"] # 0xac (en: 'not', DeepL translation) + - "´": [T: "éles ékezet"] # 0xb4 (en: 'acute', DeepL translation) + - "·": # 0xB7 + - test: + if: "$SpeechStyle != 'ClearSpeak' or $ClearSpeak_MultSymbolDot = 'Auto'" + then: [T: "szorozva"] # (en: 'dot', DeepL translation) + else: [T: "pont"] # (DeepL translation) + - "×": # 0xd7 + - test: + if: "$SpeechStyle != 'ClearSpeak' or $ClearSpeak_MultSymbolX = 'Auto'" + then: [T: "szorozva"] + else_test: + if: $ClearSpeak_MultSymbolX = 'By' + then: [T: "szorozva"] + else: [T: "kereszt"] # (en: 'cross', DeepL translation) + - "÷": [T: "osztva"] # 0xf7 (en: 'divided by', DeepL translation) + - "̀": [T: "súlyos ékezet díszítés"] # 0x300 (en: 'grave accent embellishment', DeepL translation) + - "́": [T: "akut ékezet díszítés"] # 0x301 (en: 'acute accent embellishment', DeepL translation) + - "̂": [T: "cirkumflex ékezet díszítés"] # 0x302 (en: 'circumflex accent embellishment', DeepL translation) + - "̃": [T: "tilde"] # 0x303 (en: 'tilde embellishment', DeepL translation) + - "̄": [T: "makron"] # 0x304 (en: 'macron embellishment', DeepL translation) + - "̅": [T: "túlszárnyaló díszítés"] # 0x305 (en: 'overbar embellishment', DeepL translation) + - "̆": [T: "rövid"] # 0x306 (DeepL translation) + - "̇": [T: "pont a díszítés felett"] # 0x307 (en: 'dot above embellishment', DeepL translation) + - "ϖ": [T: "pí"] # 0x3d6 (DeepL translation) + - "ϵ": [T: "holdkóros epszilon"] # 0x3f5 (DeepL translation) + - "϶": [T: "félhold alakú tükrözött görög epszilon"] # 0x3f6 (en: 'reversed epsilon', DeepL translation) + - "…": # 0x2026 + test: + if: + - "$SpeechStyle != 'ClearSpeak' or $ClearSpeak_Ellipses = 'Auto' or" + # must be ClearSpeak and $ClearSpeak_Ellipses = 'AndSoOn' + # speak '…' as 'and so on...' unless expr starts with '…' + - "../*[1][.='…']" + then: [T: "pont pont pont"] # (en: 'dot dot dot', DeepL translation) + else_test: # must have $ClearSpeak_Ellipses = 'AndSoOn' + if: "count(following-sibling::*) = 0" + then: [T: "és így tovább"] # (en: 'and so on', DeepL translation) + else: [T: "és így tovább egészen az alábbi értékig:"] # (en: 'and so on up to', DeepL translation) + - "ℓ": [T: "alsó index l"] # 0x2113 + - "ϕ": [T: "phi"] # 0x3d5 (DeepL translation) + - "⇒": [T: "dupla jobbranyíl"] # 0x21d2 (en: 'right double arrow', DeepL translation) + - "∂": # 0x2202 + - test: + if: "$Verbosity='Terse'" + then: [T: "részleges"] # (en: 'partial', DeepL translation) + else: [T: "parciális derivált"] # (en: 'partial derivative', DeepL translation) + - "∆": # 0x2206 + - test: + if: "following-sibling::*" + then_test: + if: "$Verbosity!='Terse'" + then: [T: "egy laplaciánus"] # "LahPlahsian" sounds better than "laplacian" in speech engines tested + else: [T: "laplaciánus"] + else: [T: "laplaciánus"] + + + - "∉": # 0x2209 + # rule is identical to 0x2208 + - test: + if: "$SpeechStyle != 'ClearSpeak'" + then: [T: "nem eleme ennek:"] + # Several options for speaking elements in ClearSpeak -- they split between being inside a set or not and then the option + else_test: + if: "../../self::m:set or ../../../self::m:set" # inside a set + then_test: + - if: $ClearSpeak_SetMemberSymbol = 'Auto' or $ClearSpeak_SetMemberSymbol = 'In' + then: [T: "nincs benne:"] + - else_if: $ClearSpeak_SetMemberSymbol = 'Member' + then: [T: "nem tagja ennek:"] + - else_if: $ClearSpeak_SetMemberSymbol = 'Element' + then: [T: "nem eleme ennek:"] + - else: [T: "nem tartozik hozzá:"] # $ClearSpeak_SetMemberSymbol = 'Belongs' + else_test: + - if: $ClearSpeak_SetMemberSymbol = 'Auto' or $ClearSpeak_SetMemberSymbol = 'Member' + then: [T: "nem tagja az alábbi halmaznak:"] + - else_if: $ClearSpeak_SetMemberSymbol = 'Element' + then: [T: "nem eleme ennek:"] + - else_if: $ClearSpeak_SetMemberSymbol = 'In' + then: [T: "nincs benne:"] + - else: [T: "nem tartozik hozzá:"] # $ClearSpeak_SetMemberSymbol = 'Belongs' + + - "∊": # 0x220a + - test: + if: "$SpeechStyle != 'ClearSpeak'" + then: + - test: + if: "$Verbosity!='Terse' and not(parent::m:set)" # "the set x is an element of ..." sounds bad + then: [T: "van"] # (en: 'is', DeepL translation) + - T: "egy eleme" # (en: 'an element of', DeepL translation) + # Several options for speaking elements in ClearSpeak -- they split between being inside a set or not and then the option + else_test: + if: "../../self::m:set or ../../../self::m:set" # inside a set + then_test: + - if: $ClearSpeak_SetMemberSymbol = 'Auto' or $ClearSpeak_SetMemberSymbol = 'In' + then: [T: ""] # (DeepL translation) + - else_if: $ClearSpeak_SetMemberSymbol = 'Member' + then: [T: "tagja ennek:"] # (en: 'member of', DeepL translation) + - else_if: $ClearSpeak_SetMemberSymbol = 'Element' + then: [T: "eleme ennek:"] # (en: 'element of', DeepL translation) + - else: [T: "hozzátartozó eleme ennek:"] # $ClearSpeak_SetMemberSymbol = 'Belongs' (en: 'belonging to', DeepL translation) + else_test: + - if: $ClearSpeak_SetMemberSymbol = 'Auto' or $ClearSpeak_SetMemberSymbol = 'Member' + then: [T: "tagja az alábbi halmaznak:"] # (en: 'is a member of', DeepL translation) + - else_if: $ClearSpeak_SetMemberSymbol = 'Element' + then: [T: "egy eleme ennek:"] # (en: 'is an element of', DeepL translation) + - else_if: $ClearSpeak_SetMemberSymbol = 'In' + then: [T: "benne van ebben:"] # (en: 'is in', DeepL translation) + - else: [T: "ebbe a halmazba tartozik:"] # $ClearSpeak_SetMemberSymbol = 'Belongs' (en: 'belongs to', DeepL translation) + - "∐": [T: "diszjunkt unió"] # 0x2210 (en: 'co-product', DeepL translation) + - "√": # 0x221a + - test: + if: "$Verbosity!='Terse'" + then: [T: "a"] # (en: 'the', DeepL translation) + - T: "négyzetgyöke" # (en: 'square root of', DeepL translation) + - "∝": # 0x221d + - test: + if: "$Verbosity!='Terse'" + then: [T: ""] # (en: 'is', DeepL translation) + - T: "arányos" # (en: 'proportional to', DeepL translation) + - "∶": # 0x2236 + - test: + if: "$Verbosity!='Terse'" + then: [T: "van"] # (en: 'is', DeepL translation) + - T: "hogy" # (DeepL translation) + - "∾": # 0x223e + - test: + if: "$Verbosity!='Terse'" + then: [T: "van"] # (en: 'is', DeepL translation) + - T: "legpozitívabb" # (en: 'most positive', DeepL translation) + - "≠": # 0x2260 + - test: + if: "$Verbosity!='Terse'" + then: [T: "van"] # (en: 'is', DeepL translation) + - T: "nem egyenlő" # (en: 'not equal to', DeepL translation) + - "≡": # 0x2261 + - test: + if: "$Verbosity!='Terse'" + then: [T: "van"] # (en: 'is', DeepL translation) + - T: "azonos" # (en: 'identical to', DeepL translation) + - "⊂": # 0x2282 + - test: + if: "$Verbosity!='Terse'" + then: [T: "egy"] # (DeepL translation) + - T: "részhalmaza" # (en: 'subset of', DeepL translation) + - "⊃": # 0x2283 + - test: + if: "$Verbosity!='Terse'" + then: [T: "egy"] # (DeepL translation) + - T: "szuperhalmaza ennek:" # (en: 'superset of', DeepL translation) + - "⊄": # 0x2284 + - test: + if: "$Verbosity!='Terse'" + then: [T: "egy"] # (en: 'is', DeepL translation) + - T: "nem részhalmaza ennek:" # (en: 'not a subset of', DeepL translation) + - "⊅": # 0x2285 + - test: + if: "$Verbosity!='Terse'" + then: [T: "egy"] # (en: 'is', DeepL translation) + - T: "nem szuperhalmaza ennek:" # (DeepL translation) + - "⊆": # 0x2286 + - test: + if: "$Verbosity!='Terse'" + then: [T: "egy"] # (DeepL translation) + - T: "részhalmaza vagy egyenlő" # (en: 'subset of or equal to', DeepL translation) + - "⊇": # 0x2287 + - test: + if: "$Verbosity!='Terse'" + then: [T: "egy"] # (DeepL translation) + - T: "szuperhalmaza vagy egyenlő" # (en: 'superset of or equal to', DeepL translation) + - "ⅆ": [T: "d"] # 0x2146 + - "": [T: "e"] # 0xed11 + - "ⅈ": [T: "i"] # 0x2148 + - "-": # 0xf52e - 0xf537 (old MathType) + - test: + if: "not($IgnoreBold)" + then: [T: "félkövér"] + - SPELL: "translate('.', '', '0123456789')" + - "ⅇ": [T: "e"] # 0x2147 + - "Ⓐ-ⓩ": # 0x24b6 - 0x24cf + - T: "bekarikázott" + - SPELL: "translate('.', 'ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" + - "ⓐ-ⓩ": # 0x24d0 - 0x24e9 + - T: "bekarikázott" + - SPELL: "translate('.', 'ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ', 'abcdefghijklmnopqrstuvwxyz')" + + + + + + + + + + + + diff --git a/tests/Languages/hu/ClearSpeak/sets.rs b/tests/Languages/hu/ClearSpeak/sets.rs index c2b9d589a..844e2a51c 100644 --- a/tests/Languages/hu/ClearSpeak/sets.rs +++ b/tests/Languages/hu/ClearSpeak/sets.rs @@ -223,7 +223,7 @@ fn set_with_colon() -> Result<()> { let expr = " { x:x>2 } "; - test("hu", "ClearSpeak", expr, "x melyekre teljesül, hogy minden x nagyobb, mint 2")?; + test("hu", "ClearSpeak", expr, "minden x melyekre teljesül, hogy x nagyobb, mint 2")?; return Ok(()); } @@ -234,7 +234,7 @@ fn set_with_bar() -> Result<()> { let expr = " { x|x>2 } "; - test("hu", "ClearSpeak", expr, "x melyekre teljesül, hogy minden x nagyobb, mint 2")?; + test("hu", "ClearSpeak", expr, "minden x melyekre teljesül, hogy x nagyobb, mint 2")?; return Ok(()); } @@ -285,7 +285,7 @@ fn complicated_set_with_colon() -> Result<()> { 7 } "; - test("hu", "ClearSpeak", expr, "x az egész számok halmaza melyekre teljesül, hogy minden 2 kisebb, mint x kisebb, mint 7")?; + test("hu", "ClearSpeak", expr, "minden x az egész számok halmaza melyekre teljesül, hogy 2 kisebb, mint x kisebb, mint 7")?; return Ok(()); } @@ -302,7 +302,7 @@ fn complicated_set_with_mtext() -> Result<()> { } "; test("hu", "ClearSpeak", expr, - "x a természetes számok halmaza melyekre teljesül, hogy minden x páros szám")?; + "minden x a természetes számok halmaza melyekre teljesül, hogy x páros szám")?; return Ok(()); } @@ -323,7 +323,7 @@ fn set_with_bar_member() -> Result<()> { } "; test_ClearSpeak("hu", "ClearSpeak_SetMemberSymbol", "Member", - expr, "x tagja az egész számok halmaza melyekre teljesül, hogy minden x nagyobb, mint 5")?; + expr, "minden x tagja az egész számok halmaza melyekre teljesül, hogy x nagyobb, mint 5")?; return Ok(()); } @@ -375,7 +375,7 @@ fn set_with_bar_element() -> Result<()> { } "; test_ClearSpeak("hu", "ClearSpeak_SetMemberSymbol", "Element", - expr, "x eleme ennek:, az egész számok halmaza melyekre teljesül, hogy minden x nagyobb, mint 5")?; + expr, "minden x eleme ennek:, az egész számok halmaza melyekre teljesül, hogy x nagyobb, mint 5")?; return Ok(()); } @@ -426,7 +426,7 @@ fn set_with_bar_in() -> Result<()> { } "; test_ClearSpeak("hu", "ClearSpeak_SetMemberSymbol", "In", - expr, "x az egész számok halmaza melyekre teljesül, hogy minden x nagyobb, mint 5")?; + expr, "minden x az egész számok halmaza melyekre teljesül, hogy x nagyobb, mint 5")?; return Ok(()); } @@ -477,7 +477,7 @@ fn set_with_bar_belongs() -> Result<()> { } "; test_ClearSpeak("hu", "ClearSpeak_SetMemberSymbol", "Belongs", - expr, "x hozzátartozó eleme ennek:, az egész számok halmaza melyekre teljesül, hogy minden x nagyobb, mint 5")?; + expr, "minden x hozzátartozó eleme ennek:, az egész számok halmaza melyekre teljesül, hogy x nagyobb, mint 5")?; return Ok(()); } @@ -563,7 +563,7 @@ fn silent_bracket() -> Result<()> { {x|x>2} "; test_ClearSpeak("hu", "ClearSpeak_Sets", "SilentBracket", expr, - "x melyekre teljesül, hogy minden x nagyobb, mint 2")?; + "minden x melyekre teljesül, hogy x nagyobb, mint 2")?; return Ok(()); } diff --git a/tests/Languages/hu/ClearSpeak/symbols_and_adornments.rs b/tests/Languages/hu/ClearSpeak/symbols_and_adornments.rs index ff38686c6..e137a3dd3 100644 --- a/tests/Languages/hu/ClearSpeak/symbols_and_adornments.rs +++ b/tests/Languages/hu/ClearSpeak/symbols_and_adornments.rs @@ -233,7 +233,7 @@ fn vertical_line_set() -> Result<()> { } "; test_ClearSpeak("hu", "ClearSpeak_VerticalLine", "Auto", expr, - "x melyekre teljesül, hogy minden x nagyobb, mint 0")?; + "minden x melyekre teljesül, hogy x nagyobb, mint 0")?; return Ok(()); } @@ -254,7 +254,7 @@ fn vertical_line_set_such_that() -> Result<()> { } "; test_ClearSpeak("hu", "ClearSpeak_VerticalLine", "SuchThat", expr, - "x melyekre teljesül, hogy minden x nagyobb, mint 0")?; + "minden x melyekre teljesül, hogy x nagyobb, mint 0")?; return Ok(()); } @@ -275,7 +275,7 @@ fn vertical_line_set_given() -> Result<()> { "; // the rules for set will override all the options -- ClearSpeak spec should be clarified test_ClearSpeak("hu", "ClearSpeak_VerticalLine", "Given", expr, - "x melyekre teljesül, hogy minden x nagyobb, mint 0")?; + "minden x melyekre teljesül, hogy x nagyobb, mint 0")?; return Ok(()); } @@ -299,7 +299,7 @@ fn vertical_line_set_and_abs() -> Result<()> { } "; test_ClearSpeak("hu", "ClearSpeak_VerticalLine", "Auto", expr, - "x melyekre teljesül, hogy minden x abszolút értéke; nagyobb, mint 2")?; + "minden x melyekre teljesül, hogy x abszolút értéke; nagyobb, mint 2")?; return Ok(()); } diff --git a/tests/Languages/hu/definitions.rs b/tests/Languages/hu/definitions.rs index bd84fb155..7cbb36359 100644 --- a/tests/Languages/hu/definitions.rs +++ b/tests/Languages/hu/definitions.rs @@ -32,7 +32,7 @@ fn my_set_basic() -> Result<()> { "#; - test("hu", "ClearSpeak", expr, "az üres halmaz")?; + test("hu", "ClearSpeak", expr, "a halmaz x vessző, y")?; Ok(()) } @@ -91,7 +91,7 @@ fn set_difference_basic() -> Result<()> { "#; - test( "hu", "ClearSpeak", expr, "különbséghalmaz nagy a vessző, nagy b")?; + test( "hu", "ClearSpeak", expr, "különbséghalmaz nagy a és nagy b")?; Ok(()) } @@ -107,7 +107,7 @@ fn postfix_test() -> Result<()> { T "#, - "transzponált x", + "x transzponált", ), ( "highlight", @@ -205,9 +205,9 @@ fn functions_and_inverses_tests() -> Result<()> { //("fraction", "fraction x over y end fraction"), ("mixed-fraction", "x és y"), - ("quotient", "egész rész osztva x vessző, y"), + ("quotient", "egész rész x osztva y"), ("evaluated-at", "x értékelve y"), - ("remainder", "a maradék, osztva x vessző, y"), + ("remainder", "a maradék x osztva y"), ("max", "max x vessző, y vessző, z"), ("min", "min x vessző, y vessző, z"), @@ -223,13 +223,13 @@ fn functions_and_inverses_tests() -> Result<()> { ("complex-conjugate", "Komplex konjugált x"), ("complex-arg", "argumentum x"), - ("real-part", "valós rész"), - ("imaginary-part", "képzetes rész"), + ("real-part", "az igazi rész x"), + ("imaginary-part", "a képzeletbeli rész x"), ("polar-coordinate", "poláris koordináta x vessző, y"), ("spherical-coordinate", "gömb koordináta x vessző, y vessző, z"), ("cartesian-coordinate", "derékszögű koordináta x vessző, y vessző, z"), - ("coordinate", "pont, x vessző y vessző z"), + ("coordinate", "koordináta x vessző, y vessző, z"), ("floor", "lépcső x"), ("ceiling", "mennyezet x"), @@ -528,7 +528,7 @@ fn statistics_and_probability_tests() -> Result<()> { ("mode", "mód x"), // conditional probability typically two arguments - // ("conditional-probability", "probability of x given y"), + // ("conditional-probability", "valószínűség x adott y"), ]; for (intent, expected) in tests { @@ -576,7 +576,7 @@ fn linear_algebra_tests() -> Result<()> { ("span", "fesztávolság x"), // transpose supports both postfix and function; we test function explicitly - ("transpose", "transzponált x"), + ("transpose", "x transzponált"), // dimensional product is infix ("dimensional-product", "x a(z) y"), @@ -705,14 +705,12 @@ fn geometry_prefix_tests() -> Result<()> { #[test] fn separator_tests() -> Result<()> { - let expr = format!( - " + let expr = " x y - " - ); + ".to_string(); test("hu", "ClearSpeak", &expr, "x y")?; Ok(()) @@ -721,7 +719,7 @@ fn separator_tests() -> Result<()> { #[test] fn general_concepts_tests() -> Result<()> { let tests = vec![ - // Unary structural +// Unary structural ("fenced-group", "bekerített csoport x"), ("highlight", "x kiemelt"), ("least-common-denominator", "legkisebb közös nevező x vessző, y vessző, z"), // add x, y , z ... @@ -729,13 +727,13 @@ fn general_concepts_tests() -> Result<()> { ("permutation-cycle", "permutációs ciklus x"), // Binary structural / infix-style - // ("ordered-pair", "the pair of x and y"), + ("ordered-pair", "a pár x és y"), ("rate", "x per y"), ("binomial-coefficient", "x választ y"), ("embellished-name", "x megjegyzéssel y"), ("indexed-by", "x alsó index y"), - // ("translation", "translation by x comma, y"), // Changes translation to comma + ("translation", "fordítás x vessző, y"), // Changes translation to comma ("constraint", "x feltétellel y"), ]; diff --git a/tests/Languages/hu/shared.rs b/tests/Languages/hu/shared.rs index bd53bb4c3..087a203a5 100644 --- a/tests/Languages/hu/shared.rs +++ b/tests/Languages/hu/shared.rs @@ -22,7 +22,7 @@ fn modified_vars() -> Result<()> { t "; test("hu", "SimpleSpeak", expr, - "a súlyozott, b tilde, c rövid, b ellenőrzés, c súlyozott; plusz, r hacsek karakter mint repülő ékezet; plusz; x pont, y pont, z dupla pont, u hármas pont, v négyes pont; plusz x kalap, plusz vektor kezdete t")?; + "a súlyozott, b tilde, c rövid, b ellenőrzés, c súlyozott; plusz, r hacsek karakter mint repülő ékezet, plusz; x pont, y pont, z dupla pont, u hármas pont, v négyes pont; plusz x kalap, plusz vektor kezdete t")?; return Ok(()); } @@ -322,7 +322,6 @@ fn ignore_comma() -> Result<()> { // AI generated #[test] -#[ignore] // issue #14 fn ignore_period_and_space() -> Result<()> { // from https://hu.wikipedia.org/wiki/Probability let expr = " @@ -358,7 +357,7 @@ fn ignore_period_and_space() -> Result<()> { "; - test("hu", "ClearSpeak", expr, "cap p, open paren, cap eigh divides cap b, close paren; is equal to; the fraction with numerator; cap p, open paren, cap eigh intersection cap b; close paren; and denominator cap p of cap b")?; + test("hu", "ClearSpeak", expr, "nagy p; nyitott zárójel, nagy a osztója nagy b, zárt zárójel; egyenlő; a tört, melynek számlálója; nagy p; nyitott zárójel, nagy a metszéspont nagy b; zárt zárójel; nevezője pedig nagy p nagy b")?; return Ok(()); } @@ -484,7 +483,7 @@ fn literal_speak_perpendicular() -> Result<()> { "#; - test("hu", "LiteralSpeak", expr, "nagy a jobbra nyíl; merőleges nagy b jobbra nyíl")?; + test("hu", "LiteralSpeak", expr, "nagy a jobbra nyíl, merőleges nagy b jobbra nyíl")?; return Ok(()); } @@ -570,7 +569,7 @@ fn literal_intent_property() -> Result<()> { "#; - test("hu", "SimpleSpeak", expr, "nagy a jobbra nyíl; merőleges nagy b jobbra nyíl")?; + test("hu", "SimpleSpeak", expr, "nagy a jobbra nyíl, merőleges nagy b jobbra nyíl")?; return Ok(()); } From 0d869333b0dd0d3fa9b7e047dd94adfaa5e1a43f Mon Sep 17 00:00:00 2001 From: hammera Date: Mon, 17 Aug 2026 07:43:02 +0200 Subject: [PATCH 4/4] Fix a mistake after the selective merge with definitions.yaml and definition.rs test file (#697) Signed-off-by: Attila Hammer --- Rules/Languages/hu/definitions.yaml | 15 ++++++++------- tests/Languages/hu/definitions.rs | 24 ++++++++++++------------ 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Rules/Languages/hu/definitions.yaml b/Rules/Languages/hu/definitions.yaml index c76b94544..d66738ec4 100644 --- a/Rules/Languages/hu/definitions.yaml +++ b/Rules/Languages/hu/definitions.yaml @@ -87,14 +87,14 @@ #"fraction":"function=fraction; over; end fraction", # NOTE: Fails "mixed-fraction":"infix=és", # NOTE: in website says function, but follow infix speech pattern. "greatest-common-divisor": "function=a legnagyobb közös osztó", - "quotient":"function=egész rész osztva", # NOTE: Logic somewhere here failing, becomes "divided by of x comma, y" instead of "integer part of x divided by y" + "quotient":"function=egész rész | osztva", # NOTE: Logic somewhere here failing, becomes "divided by of x comma, y" instead of "integer part of x divided by y" "evaluated-at":"infix=értékelve || postfix=értékként", - "remainder":"function=a maradék, osztva", + "remainder":"function=a maradék | osztva", "max":"function=max", "min":"function=min", "power":"infix=a hatványra", "root":"function=root", - "imaginary-part": "a képzeletbeli rész", + "imaginary-part": "function=a képzeletbeli rész: a képzeletbeli rész: a képzeletbeli rész", "least-common-multiple": "function=lcm: a legkisebb közös többszörös: a legkisebb közös többszörös", "complex-conjugate":"function=Komplex konjugált", "complex-arg":"function=argumentum", @@ -131,15 +131,15 @@ "tends-to-from-below":"infix=alulról indul", ### Sets "set": "function= ; halmaz: a halmaz", - "set-difference":"function=különbséghalmaz || infix=mínusz || postfix=különbséghalmaza", # NOTE: not tested + "set-difference":"function=különbséghalmaz | és || infix=mínusz", "complement":"function=komplemens", - "empty-set":"function=üres halmaz", + "empty-set":"nofix=üres halmaz", "cardinality":"function=számosság", # NOTE: does not have a defined speech template in website "list":"function=lista", "tuple": "function= ; tuple: a tuple", ### Sequence and Series - "sum":"function= ; összegzés : összeg ; ", #: sum over : sum from; to", - "product":"function=szorzat || function=szorzat vége || function=szorzat innen ide", + "sum": "function=összeg", + "product":"function=szorzat", ### Elementary classical functions "sine":"function=szinusz: szinusz", @@ -225,6 +225,7 @@ "highlight":"postfix=kiemelt", "least-common-denominator":"function=legkisebb közös nevező", "rate":"infix=per", + "translation":"function=fordítás", "constraint":"infix= ; feltétellel; ", "binomial-coefficient":"infix=választ", diff --git a/tests/Languages/hu/definitions.rs b/tests/Languages/hu/definitions.rs index 542f41885..62f910184 100644 --- a/tests/Languages/hu/definitions.rs +++ b/tests/Languages/hu/definitions.rs @@ -32,7 +32,7 @@ fn my_set_basic() -> Result<()> { "#; - test("hu", "ClearSpeak", expr, "az üres halmaz")?; + test("hu", "ClearSpeak", expr, "a halmaz x vessző, y")?; Ok(()) } @@ -91,7 +91,7 @@ fn set_difference_basic() -> Result<()> { "#; - test( "hu", "ClearSpeak", expr, "különbséghalmaz nagy a vessző, nagy b")?; + test( "hu", "ClearSpeak", expr, "különbséghalmaz nagy a és nagy b")?; Ok(()) } @@ -107,7 +107,7 @@ fn postfix_test() -> Result<()> { T "#, - "transzponált x", + "x transzponált", ), ( "highlight", @@ -205,9 +205,9 @@ fn functions_and_inverses_tests() -> Result<()> { //("fraction", "fraction x over y end fraction"), ("mixed-fraction", "x és y"), - ("quotient", "egész rész osztva x vessző, y"), + ("quotient", "egész rész x osztva y"), ("evaluated-at", "x értékelve y"), - ("remainder", "a maradék, osztva x vessző, y"), + ("remainder", "a maradék x osztva y"), ("max", "max x vessző, y vessző, z"), ("min", "min x vessző, y vessző, z"), @@ -223,13 +223,13 @@ fn functions_and_inverses_tests() -> Result<()> { ("complex-conjugate", "Komplex konjugált x"), ("complex-arg", "argumentum x"), - ("real-part", "valós rész"), - ("imaginary-part", "képzetes rész"), + ("real-part", "az igazi rész x"), + ("imaginary-part", "a képzeletbeli rész x"), ("polar-coordinate", "poláris koordináta x vessző, y"), ("spherical-coordinate", "gömb koordináta x vessző, y vessző, z"), ("cartesian-coordinate", "derékszögű koordináta x vessző, y vessző, z"), - ("coordinate", "pont, x vessző y vessző z"), + ("coordinate", "koordináta x vessző, y vessző, z"), ("floor", "lépcső x"), ("ceiling", "mennyezet x"), @@ -528,7 +528,7 @@ fn statistics_and_probability_tests() -> Result<()> { ("mode", "mód x"), // conditional probability typically two arguments - // ("conditional-probability", "probability of x given y"), + // ("conditional-probability", "valószínűség x adott y"), ]; for (intent, expected) in tests { @@ -576,7 +576,7 @@ fn linear_algebra_tests() -> Result<()> { ("span", "fesztávolság x"), // transpose supports both postfix and function; we test function explicitly - ("transpose", "transzponált x"), + ("transpose", "x transzponált"), // dimensional product is infix ("dimensional-product", "x a(z) y"), @@ -727,13 +727,13 @@ fn general_concepts_tests() -> Result<()> { ("permutation-cycle", "permutációs ciklus x"), // Binary structural / infix-style - // ("ordered-pair", "the pair of x and y"), + ("ordered-pair", "a pár x és y"), ("rate", "x per y"), ("binomial-coefficient", "x választ y"), ("embellished-name", "x megjegyzéssel y"), ("indexed-by", "x alsó index y"), - // ("translation", "translation by x comma, y"), // Changes translation to comma + ("translation", "fordítás x vessző, y"), // Changes translation to comma ("constraint", "x feltétellel y"), ];