Skip to content
Merged
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
18 changes: 8 additions & 10 deletions Rules/Languages/hu/ClearSpeak_Rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
71 changes: 40 additions & 31 deletions Rules/Languages/hu/SharedRules/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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')] )"
Expand Down
4 changes: 2 additions & 2 deletions Rules/Languages/hu/SharedRules/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion Rules/Languages/hu/SharedRules/geometry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
Expand Down
96 changes: 77 additions & 19 deletions Rules/Languages/hu/definitions.yaml
Original file line number Diff line number Diff line change
@@ -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:
# "<intent>": "<fixity1>=<speech1> || <fixity2>=<speech2> || ...",
# or just
# "<intent>": "<speech>",
# where <speech> 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 *<speech>*, 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 ::= <intent> ":" <intent_speech>
#
# <intent_speech> ::= <fixity_speech> ( "||" <fixity_speech> )*
# | <simple_speech>
#
# <fixity_speech> ::= <fixity> "=" <speech_options>
#
# <fixity> ::= "prefix" | "infix" | "postfix" | "function" | "nofix" | "silent"
#
# <speech_options> ::= <speech_string>
# | <speech_string> "|" <arg_glue> ( "|" <arg_glue> )*
#
# <speech_string> ::= text
# # May use ":" to separate terse:medium:verbose forms.
# # May use ";" for bracketing (opening; main; closing).
#
# <arg_glue> ::= 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".
#
# <simple_speech> ::= <speech_string> (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, "<")
Expand All @@ -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",
Expand Down Expand Up @@ -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",
"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",
Expand Down Expand Up @@ -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
Expand All @@ -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


Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Loading