Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 38 additions & 9 deletions Rules/Languages/pl/SharedRules/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,18 @@
- x: "count(preceding-sibling::*)+IfThenElse(parent::m:mlabeledtr, 0, 1)"
- pause: medium
- x: "*"
- test:
if: "HasVisibleColumnLine(../.., count(preceding-sibling::*) + 1)"
then:
- pause: short
- T: "separator"
- test:
# Separator wiersza zapowiadamy tylko po ostatniej komórce wiersza, żeby
# wybrzmiał raz na każdą granicę poziomą.
if: "count(following-sibling::*) = 0 and HasVisibleRowLine(../.., count(../preceding-sibling::*) + 1)"
then:
- pause: short
- T: "separator wiersza"
- 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
Expand Down Expand Up @@ -737,21 +749,38 @@

- name: function-intent
# uncaught intent -- speak as foo of arg1 comma arg2 .... The MathML spec requires arguments to functions
# IntentMappings mogą dodać po nazwie opcje spoiwa "| ...":
# * jedna opcja bez przecinka: separator dwuargumentowy po "z"
# (np. "| podzielone przez" daje "część całkowita z x podzielone przez y")
# * wiele opcji albo opcja z przecinkami: szablony arności; k słów spoiwa
# opisuje k+1 argumentów (np. "| po | od,do")
# * gdy arność nie pasuje, argumenty rozdziela przecinek
tag: "*"
match: "count(*)>0"
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: "z", 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: "z", 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')] )"
Expand Down
10 changes: 7 additions & 3 deletions Rules/Languages/pl/SharedRules/geometry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@

- name: coordinate
tag: coordinate
match: "."
# Intencje postaci coordinate($x,...) mają @arg i spadają do function-intent / IntentMappings
match: "not(*[@arg])"
replace:
- T: "przecinek" # phrase(the 'point' at 1, 2)
- test:
if: "$Verbosity='Verbose'"
then: [t: "w"] # phrase('the' point at 1, 2)
then: [OT: "ten"] # phrase('the' point at 1, 2)
- T: "punkt" # phrase(the 'point' at 1, 2)
- test:
if: "$Verbosity='Verbose'"
then: [T: "w"] # phrase('the' point at 1, 2)
- pause: short
- insert:
nodes: "*"
Expand Down
35 changes: 21 additions & 14 deletions Rules/Languages/pl/definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

"image":"function=obraz",
"mixed-fraction":"infix=i",
"quotient":"function=część całkowita; podzielone przez",
"quotient":"function=część całkowita | podzielone przez",
"evaluated-at":"infix=obliczone w",
"remainder":"function=reszta; podzielone przez",
"remainder":"function=reszta | podzielone przez",

"max":"function=maksimum",
"min":"function=minimum",
Expand All @@ -32,10 +32,10 @@
"real-part": "function=część rzeczywista",
"imaginary-part": "function=część urojona: część urojona: część urojona",

"polar-coordinate":"function=współrzędna biegunowa; przecinek",
"spherical-coordinate":"function=współrzędna sferyczna; przecinek; przecinek",
"cartesian-coordinate":"function=współrzędna kartezjańska; przecinek",
"coordinate":"function=współrzędna; przecinek",
"polar-coordinate":"function=współrzędna biegunowa",
"spherical-coordinate":"function=współrzędna sferyczna",
"cartesian-coordinate":"function=współrzędna kartezjańska",
"coordinate":"function=współrzędna",
"floor":"function=podłoga",
"ceiling":"function=sufit",
"round":"function=zaokrąglenie",
Expand All @@ -51,16 +51,23 @@

### Sets
"set": "function=; zbiór: zbiór",
"set-difference":"function=różnica zbiorów; i || infix=minus", # NOTE: not tested
"set-difference":"function=różnica zbiorów | i || infix=minus",
"complement":"function=dopełnienie",
"empty-set":"nofix=zbiór pusty",
"cardinality":"function=moc zbioru",
"list":"function=lista",
"tuple": "function=; krotka: krotka",


### Sequence and Series
"sum":"function=; suma po: suma; ",
"product":"function=iloczyn || function=iloczyn po || function=iloczyn od; do",
# UWAGA: NIE używamy tu szablonów arności ("| po | od,do"), choć angielski je ma.
# Powód (zmierzone 31.08.2026): intent_function_glue_before w src/infer_intent.rs
# zwraca dla ostatniego argumentu ZASZYTE W KODZIE angielskie "of", więc polskie
# wyjście brzmiałoby "suma po i of x". To defekt rdzenia dotyczący każdego języka
# poza angielskim; węgierski uniknął go tak samo, zostawiając prostą postać.
# Separator binarny (jedna opcja "| słowo") działa poprawnie i jest używany niżej.
"sum":"function=suma",
"product":"function=iloczyn",


### Elementary classical functions
Expand Down Expand Up @@ -104,7 +111,7 @@
"median":"function=mediana",
"mode":"function=dominanta",

"conditional-probability":"function=prawdopodobieństwo; pod warunkiem", # NOTE: Check test
"conditional-probability":"function=prawdopodobieństwo | pod warunkiem",


### Linear Algebra
Expand All @@ -120,7 +127,7 @@
"unit-vector":"prefix=wektor jednostkowy",

"identity-matrix":"nofix=macierz jednostkowa", # NOTE: no function specified
"transpose":"function=transpozycja || postfix=transponowane",
"transpose":"postfix=transponowane || function=transpozycja",
"dimensional-product":"infix=na", # INFIX


Expand Down Expand Up @@ -150,13 +157,13 @@

### General Concepts
"fenced-group":"function=grupa w nawiasach",
"ordered-pair": "function=; para; i",
"ordered-pair": "function=para | i",
"indexed-by": "infix=; indeks dolny; koniec indeksu dolnego",

"highlight":"postfix=podświetlone",
"least-common-denominator":"function=najmniejszy wspólny mianownik",
"rate":"infix=na",
"translation":"function=przesunięcie o; przecinek",
"translation":"function=przesunięcie o",
"constraint":"infix=; przy warunku; ",

"binomial-coefficient":"infix=po",
Expand Down Expand Up @@ -264,7 +271,7 @@
## Default fixity nofix
"diameter":"nofix=d: średnica",
"distance":"nofix=d; D: odległość",
"probability":"nofix=P: prawdopodobieństwo",
"probability":"nofix=P: prawdopodobieństwo || function=prawdopodobieństwo",
"radius":"nofix=r: promień",
"volume":"nofix=V: objętość || function=objętość",
"exponential-e":"nofix=e",
Expand Down
80 changes: 57 additions & 23 deletions Rules/Languages/pl/navigate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,39 +53,46 @@
then: [t: "maksymalnie oddalono", pause: "medium"]
else:
- test:
- if: "starts-with($NavCommand, 'Zoom')"
then: [set_variables: [Prefix: "'przybliż'"]] # phrase('zoom' in to see more details)
# CommandOffset to 1 + długość ANGIELSKIEGO rdzenia $NavCommand
# (Zoom/Move/Read/Describe), a NIE długość wymawianego $Prefix -
# dzięki temu tłumaczenie może mieć słowo Prefix innej długości.
# Angielskie "zoom" obsługuje oba kierunki, polski ma dwa różne
# czasowniki - "przybliż na zewnątrz" byłoby sprzeczne.
- if: "starts-with($NavCommand, 'ZoomOut')"
then: [set_variables: [Prefix: "'oddal'", CommandOffset: "5"]] # phrase('zoom' out to see less detail)
- else_if: "starts-with($NavCommand, 'Zoom')"
then: [set_variables: [Prefix: "'przybliż'", CommandOffset: "5"]] # phrase('zoom' in to see more details)
- else_if: "starts-with($NavCommand, 'Move')"
then: [set_variables: [Prefix: "'przejdź'"]] # phrase('move' to next entry in table)
then: [set_variables: [Prefix: "'przejdź'", CommandOffset: "5"]] # phrase('move' to next entry in table)
- else_if: "starts-with($NavCommand, 'Read')"
then: [set_variables: [Prefix: "'odczytaj'"]] # phrase('read' to next entry in table)
then: [set_variables: [Prefix: "'odczytaj'", CommandOffset: "5"]] # phrase('read' to next entry in table)
- else_if: "starts-with($NavCommand, 'Describe')"
then: [set_variables: [Prefix: "'opisz'"]] # phrase('describe' to next entry in table)
then: [set_variables: [Prefix: "'opisz'", CommandOffset: "9"]] # phrase('describe' to next entry in table)
- test:
if: "$Prefix != ''"
then:
- x: "$Prefix"
- test:
- if: "substring($NavCommand, string-length($Prefix)+1) = 'In'"
then: [T: "do"] # phrase(zoom 'in' to see more details)
- else_if: "substring($NavCommand, string-length($Prefix)+1) = 'InAll'"
- if: "substring($NavCommand, $CommandOffset) = 'In'"
then: [] # sam czasownik "przybliż" wystarcza
- 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: "maksymalnie do środka"] # phrase(zoom 'out all the way' to see more details)
- else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Out'"
then: [t: "na zewnątrz"] # phrase(zoom 'out' to see more details)
- else_if: "substring($NavCommand, string-length($Prefix)+1) = 'OutAll'"
then: [T: "maksymalnie"] # phrase(zoom 'in all of the way' to see more details)
- else_if: "substring($NavCommand, $CommandOffset) = 'Out'"
then: [] # sam czasownik "oddal" wystarcza
- 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: "maksymalnie na zewnątrz"] # phrase(zoom 'out all the way' to see more details)
- else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Next'"
then: [t: "w prawo"] # phrase(move to the 'right')
- else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Previous'"
then: [t: "w lewo"] # phrase(move to the 'left')
- else_if: "substring($NavCommand, string-length($Prefix)+1) = 'Current'"
then: [t: "bieżący"] # phrase(who is the 'current' president)
- else_if: "substring($NavCommand, string-length($Prefix)+1) = 'LineStart'"
then: [t: "do początku linii"] # phrase(move 'to start of line')
- else_if: "substring($NavCommand, string-length($Prefix)+1) = 'LineEnd'"
then: [t: "do końca linii"] # phrase(move 'to end of line')
then: [T: "maksymalnie"] # phrase(zoom 'out all of the way' to see more details)
- else_if: "substring($NavCommand, $CommandOffset) = 'Next'"
then: [T: "w prawo"] # phrase(move to the 'right')
- else_if: "substring($NavCommand, $CommandOffset) = 'Previous'"
then: [T: "w lewo"] # phrase(move to the 'left')
- else_if: "substring($NavCommand, $CommandOffset) = 'Current'"
then: [T: "bieżący"] # phrase(who is the 'current' president)
- else_if: "substring($NavCommand, $CommandOffset) = 'LineStart'"
then: [T: "do początku linii"] # phrase(move 'to start of line')
- else_if: "substring($NavCommand, $CommandOffset) = 'LineEnd'"
then: [T: "do końca linii"] # phrase(move 'to end of line')
- pause: "medium"
- set_variables: [MatchCounter: "$MatchCounter + 1"]

Expand All @@ -96,6 +103,15 @@
(name(.)='mrow' or name(.) = 'mtr' or name(.) = 'mlabeledtr' or @data-from-mathml = 'mtable')"
replace: []

- name: into-or-out-of-prefix-or-silent-without-parts
tag: "*"
# Intencje prefiksowe i ciche bez wpisu w NavigationParts (np. minus unarny,
# x z daszkiem) NIE powinny zapowiadać "do"/"na zewnątrz".
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'"
Expand Down Expand Up @@ -168,6 +184,24 @@
- test:
- if: "$PartName != ''"
then: [x: "$PartName"]
- else_if: "count(*) = 1"
then_test:
if: "$NavVerbosity = 'Verbose'"
then: # IntentMappings przez SpeakIntentName; w razie braku - nazwa intentu ze spacjami
- 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: "części" # phrase(the 'part' of the expression)
- x: "count($Child2D/preceding-sibling::*) + 1"
Expand Down
Loading