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
6 changes: 3 additions & 3 deletions Rules/Languages/it/definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"lim-sup": "prefix=lim sup per: il limite superiore per: il limite superiore per",
"lim-inf": "prefix=lim inf per: il limite inferiore per : il limite inferiore per",
"logarithm-with-base": "prefix=log base: il logaritmo in base: il log in base",
"minus": "infix=meno || prefix=negativo",
"plus": "infix=più || prefix=positivo",
"minus": "infix=meno || prefix=meno",
"plus": "infix=più || prefix=più",

"transpose": "postfix=trasposta || function=trasposta",
"norm": "function=; regola: regola: la regola; fine regola",
Expand All @@ -37,7 +37,7 @@
"homomorphism": "function= ; omomorfismo : omomorfismo di: l'omomorfismo di; fine omomorfismo",
"kernel": "function= ; nucleo : nucleo di: il nucleo di; fine nucleo",
"vector": "function= ; vettore || prefix=vettore",
"cross-product": "infix=vettoriale: prodoto verttoriale: prodotto vettoriale",
"cross-product": "infix=vettoriale: prodotto vettoriale: prodotto vettoriale",
"dot-product": "infix=scalare: prodotto scalare: dot:prodotto scalare",

"divergence": "function= ; div: divergenza: divergenza; fine divergenza",
Expand Down
16 changes: 8 additions & 8 deletions Rules/Languages/it/unicode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
- "!": [T: "fattoriale"] # 0x21
- "\"": [T: "barra inversa"] # 0x22 (en: 'quotation mark')
- "#": [T: "almohadilla"] # 0x23 (en: 'number', MathPlayer: 'signo de número', google: 'número')
- "$": [T: "dólar"] # 0x24 (en: 'dollars')
- "$": [T: "dóllari"] # 0x24 (en: 'dollars')
- "%": [T: "porciento"] # 0x25 (en: 'percent')
- "&": [T: "e commerciale"] # 0x26
- "'": [T: "apostrofo"] # 0x27 (en: 'apostrophe', MathPlayer: 'apóstrofo', google: 'apóstrofe')
Expand Down Expand Up @@ -96,7 +96,7 @@
- "=": # 0x3d
- test:
if: "$Verbosity!='Terse'"
then: [T: "è iuguale a"] # (en: 'is equal to', google translation)
then: [T: "è uguale a"] # (en: 'is equal to', google translation)
else: [T: "uguale a"] # (en: 'equals', google: 'iguales')

- ">": # 0x3e
Expand All @@ -105,7 +105,7 @@
then: [T: "è"] # (en: 'is', google translation)
- T: "maggiore di" # (en: 'greater than')
- "?": [T: "punto di domanda"] # 0x3f (en: 'question mark', MathPlayer: 'cierra interrogación', google: 'signo de interrogación')
- "@": [T: "arroba"] # 0x40 (en: 'at sign')
- "@": [T: "chiocciola"] # 0x40 (en: 'at sign')
- "[": # 0x5b
- test:
if: $SpeechStyle = 'ClearSpeak' or $SpeechStyle = 'SimpleSpeak'
Expand All @@ -129,9 +129,9 @@
# note: for ClearSpeak and SimpleSpeak, "|" inside of sets is handled at the mrow level, same for 'sets'
- test:
- if: "$SpeechStyle != 'ClearSpeak' or not(preceding-sibling::*) or not(following-sibling::*)"
then: [T: "barra vertical"] # (en: 'verticale line', google translation)
then: [T: "barra verticale"] # (en: 'verticale line', google translation)
- else_if: "$ClearSpeak_VerticalLine = 'SuchThat'"
then: [T: "tal que"] # (en: 'tale che', google translation)
then: [T: "tale che"] # (en: 'tale che', google translation)
- else_if: "$ClearSpeak_VerticalLine = 'Given'"
then: [T: "dato"] # (en: 'given', google translation)
- else: [T: "barra verticale"] # (en: 'divides')
Expand Down Expand Up @@ -192,7 +192,7 @@
if: "$SpeechOverrides_CapitalLetters = ''"
then_test:
if: "$Impairment = 'Blindness'"
then: [T: "maiuscula"] # (en: 'cap', google translation)
then: [T: "maiuscola"] # (en: 'cap', google translation)
else: [x: "$SpeechOverrides_CapitalLetters"]
- pitch:
value: "$CapitalLetters_Pitch"
Expand Down Expand Up @@ -287,7 +287,7 @@
- "K": [T: "gradi Kelvin"] # 0x212a (en: 'kelvin')
- "Å": [T: "angstrom"] # 0x212b (en: 'angstroms')
- "ⅆⅇⅈⅉ": # 0x2146-9
- T: "angstrom in grassetto lavagna" # (en: 'double-struck italic')
- T: "angstrom" # (en: 'double-struck italic')
- spell: "translate('.', 'ⅆⅇⅈⅉ', 'deij')"

- "←": [T: "freccia sinistra"] # 0x2190 (en: 'leftwards arrow')
Expand Down Expand Up @@ -442,7 +442,7 @@
- "≠": # 0x2260
- test:
if: "$Verbosity!='Terse'"
then: [T: "es"] # (en: 'is', google translation)
then: [T: "è"] # (en: 'is', google translation)
- T: "diverso da" # (en: 'not equal to', MathPlayer: 'distinto de', google: 'no igual a')
- "≡": # 0x2261
- test:
Expand Down
48 changes: 24 additions & 24 deletions Rules/Languages/zh/tw/definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
# base units
"A": "安培",
"cd": "燭光",
"K": "凱氏", "K": "凱氏", # U+212A
"K": "K", "K": "K", # U+212A
"g": "克",
"m": "米", # British spelling works for US also
"mol": "莫耳",
Expand All @@ -97,23 +97,23 @@
"C": "庫侖",
"°C": "攝氏度", "℃": "攝氏度",
"F": "法拉",
"Gy": "格雷",
"Gy": "戈雷",
"H": "亨利",
"Hz": "赫茲",
"J": "焦耳",
"kat": "kattel",
"kat": "卡塔爾",
"lm": "流明",
"lx": "勒克斯",
"N": "牛頓",
"Ω": "歐姆", "Ω": "歐姆", # Greek Cap letter, U+2126 OHM SIGN
"Pa": "帕",
"rad": "弳",
"S": "西門子",
"S": "西門",
"Sv": "西弗",
"sr": "sterradion",
"sr": "立弳",
"T": "特士拉",
"V": "伏特",
"W": "瓦特",
"W": "",
"Wb": "韋伯",

# accepted (plus a few variants) that take SI prefixes
Expand All @@ -127,8 +127,8 @@

# copy from english version by hjy
# others that take a prefix
"a": "annum", # should only take positive powers
"as": "弧秒", # see en.wikipedia.org/wiki/Minute_and_second_of_arc
"a": "", # should only take positive powers
"as": "角秒", # see en.wikipedia.org/wiki/Minute_and_second_of_arc

# Copy from english version by hjy
# technically wrong, but used in practice with SI Units
Expand All @@ -140,25 +140,25 @@

- UnitsWithoutPrefixes: {
# time
"″": "秒", "\"": "秒",
"′": "分", "'": "分","min": "分",
"h": "", "hr": "", "Hr": "",
"h": "小時", "hr": "小時", "Hr": "小時",
"d": "天", "dy": "天",
"w": "週", "wk": "週",
"y": "年", "yr": "年",

# angles (could be temperature)
"°": "度", "deg": "度",
"arcmin": "弧分",
"amin": "弧分",
"am": "弧分",
"MOA": "弧分",
"arcsec": "弧秒",
"asec": "弧秒",
"as": "弧秒",
"arcmin": "角分",
"amin": "角分",
"am": "角分",
"MOA": "角分",
"arcsec": "角秒",
"asec": "角秒",
"as": "角秒",

# other accepted units that don't take SI prefixes
"ha": "公頃",
"Np": "奈培",
"B": "貝爾",
"dB": "分貝",

Expand All @@ -173,13 +173,13 @@
"bar": "巴",
"cal": "卡",
"Ci": "居里",
"grad": "百分直角",
"grad": "百分度",
"M": "體積莫耳濃度",
"R": "倫琴",
"rpm": "轉速每分鐘",
"R": "侖琴",
"rpm": "轉每分",
"℧": "姆歐",
"dyn": "達因",
"erg": "爾格",
"erg": "耳格",
# copy from english version by hjy
# powers of 2 used with bits and bytes
"Kib": "kibi-位元", "Mib": "mebi-位元", "Gib": "gibi-位元", "Tib": "tebi-位元", "Pib": "pebi-位元", "Eib": "exbi-位元", "Zib": "zebi-位元", "Yib": "yobi-位元",
Expand Down Expand Up @@ -236,7 +236,7 @@

# energy
"hp": "馬力",
"BTU": "英熱單位",
"BTU": "BTU",
"°F": "華氏度", "℉": "華氏度",

# other
Expand All @@ -252,8 +252,8 @@
"degree celsius": "攝氏度",
"degree fahrenheit": "華氏度",
"hertz": "赫茲",
"siemens": "西門子",
"revolution per minute": "轉速每分鐘",
"siemens": "西門",
"revolution per minute": "轉每分",
}


Expand Down
12 changes: 6 additions & 6 deletions Rules/Languages/zh/tw/navigate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1620,14 +1620,14 @@
- test:
- if: "$NavMode = 'Enhanced'"
then:
- T: "符號" # phrase(a mathematical 'character')
- T: "字元" # phrase(a mathematical 'character')
- set_variables: [NavMode: "'Character'", ReadZoomLevel: "1"]
- else_if: "$NavMode = 'Character'"
then:
- T: "簡單的" # phrase(a 'simple' way to do something)
- T: "簡單" # phrase(a 'simple' way to do something)
- set_variables: [NavMode: "'Simple'", ReadZoomLevel: "1"]
- else:
- T: "增強的" # phrase(an 'enhanced' way to do something)
- T: "增強" # phrase(an 'enhanced' way to do something)
- set_variables: [NavMode: "'Enhanced'", ReadZoomLevel: "-1"]
- T: "模式" # phrase(a simple 'mode' of use)
- pause: long
Expand All @@ -1645,14 +1645,14 @@
- test:
- if: "$NavMode = 'Enhanced'"
then:
- T: "簡單的" # phrase(an 'simple' way to do something)
- T: "簡單" # phrase(an 'simple' way to do something)
- set_variables: [NavMode: "'Simple'", ReadZoomLevel: "1"]
- else_if: "$NavMode = 'Character'"
then:
- T: "增強的" # phrase(an 'enhanced' way to do something)
- T: "增強" # phrase(an 'enhanced' way to do something)
- set_variables: [NavMode: "'Enhanced'", ReadZoomLevel: "-1"]
- else:
- T: "符號" # phrase(a mathematical 'character')
- T: "字元" # phrase(a mathematical 'character')
- set_variables: [NavMode: "'Character'", ReadZoomLevel: "1"]
- T: "模式" # phrase(a simple 'mode' of use)
- pause: long
Expand Down
11 changes: 3 additions & 8 deletions src/xpath_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ fn get_text_from_element(e: Element) -> String {
#[allow(non_snake_case)]
// Same as 'is_tag', but for ChildOfElement
fn get_text_from_COE(coe: &ChildOfElement) -> String {
let element = coe.element();
return match element {
Some(e) => get_text_from_element(e),
None => "".to_string(),
};
coe.element().map_or_else(String::new, get_text_from_element)
}

// make sure that there is only one node in the NodeSet
Expand All @@ -73,8 +69,7 @@ fn is_tag(e: Element, name: &str) -> bool {
#[allow(non_snake_case)]
// Same as 'is_tag', but for ChildOfElement
fn is_COE_tag(coe: ChildOfElement, name: &str) -> bool {
let element = coe.element();
return element.is_some() && is_tag(element.unwrap(), name)
coe.element().is_some_and(|element| is_tag(element, name))
}

/// Should be an internal structure for implementation of the IsNode, but it was useful in one place in a separate module.
Expand Down Expand Up @@ -1636,4 +1631,4 @@ mod tests {
let mn = as_element(as_element(fraction.children()[1]).children()[0]);
assert_eq!(EdgeNode::edge_node(mn, true, "2D"), None);
}
}
}
Loading
Loading