daisy / daisy/MathCAT

feature request for vector from O to A

Open Beginner friendly
#621 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
114
Forks
85
Avg merge
1d 11h
Merged PRs (30d)
42

Description

In some area, people use `$\overset{\rightharpoonup}{OA}$` to denote a vector from point O to point A.
In all area, people use `$\overline{OA}$` to denote a line segment from point O to point A.

In Intent/geometry.yaml, there is already a rule geometry-line-segment(mover) for line segment:
```
-
name: geometry-line-segment
tag: mover
match:
- "*[2][self::m:mo][.='¯'] and"
- "*[1][self::m:mrow][count(*)=3 and "
- " *[1][self::m:mi and string-length(text()) and translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '') = ''] and"
- " *[2][self::m:mo and (.='\u2062' or .='\u2063')] and"
- " *[3][self::m:mi and string-length(text()) and translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '') = '']"
- " ]"
replace:
- intent:
name: "line-segment"
attrs: "data-intent-property='concat(data-intent-property, \":prefix:\")'"
children:
- x: "*[1]/*[1]"
- x: "*[1]/*[3]"
```

hope MathCAT can add new rule geometry-harpoonvector(mover) for vector in Intent/geometry.yaml:
```
-
name: geometry-harpoonvector
tag: mover
match:
- "*[2][self::m:mo][.='⇀'] and" # u21c0
- "*[1][self::m:mrow][count(*)=3 and "
- " *[1][self::m:mi and translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '') = ''] and"
- " *[2][self::m:mo and (.='\u2062' or .='\u2063')] and"
- " *[3][self::m:mi and translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '') = '']"
- " ]"
replace:
- intent:
name: "harpoonvector"
attrs: "data-intent-property='concat(data-intent-property, \":prefix:\")'"
children:
- x: "*[1]/*[1]"
- x: "*[1]/*[3]"
```
Here we use harpoonvector instead of vector, because MathCAT already have a rule vector(mover) with intent name vector in Intent/general.yaml.

So people can add rule in local zh/tw/SharedRules/geometry.yaml as
```
- name: geometry-harpoonvector
tag: harpoonvector
match: "count(*)=2"
replace:
- test:
if: "$Verbosity='Verbose'"
then:
- T: "向量" # phrase('vector' from A to B)
- x: "*[1]"
- T: "到" # phrase(the vector from A 'to' B)
- x: "*[2]"
else:
- T: "向量" # phrase(the 'vector'A B)
- x: "*[1]"
- x: "*[2]"
```

Then people can use `$\overset{\rightharpoonup}{OA}$` to display a vector from point O to point A.

Because, translator should not add rules in Intent/geometry.yaml, so raise this feature request.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the existing geometry-line-segment rule in Intent/geometry.yaml and the vector(mover) rule in Intent/general.yaml. Compare the proposed harpoonvector rule with the local zh/tw/SharedRules/geometry.yaml example, then verify that the harpoon notation receives the harpoonvector intent and is spoken as a vector from O to A.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
accessibility, localization
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.