Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix part of #4044: Add accessibility string generation support for math expressions #4063

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
317 commits
Select commit Hold shift + click to select a range
e50a50f
Lint fix.
BenHenning Jan 14, 2022
c2726ac
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Jan 14, 2022
ec575b7
Fix failing static checks.
BenHenning Jan 14, 2022
5fe790a
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Jan 14, 2022
1268fc5
Fix broken CI checks.
BenHenning Jan 14, 2022
977eb9e
Lint fixes.
BenHenning Jan 14, 2022
a7ab1a5
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Jan 14, 2022
eed21d5
Add docs & exempted tests.
BenHenning Jan 14, 2022
b1102a3
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Jan 14, 2022
080e7dd
Remove blank line.
BenHenning Jan 14, 2022
904aad8
Add docs + tests.
BenHenning Jan 19, 2022
61fbfe5
Merge branch 'add-support-for-math-expressions-pt5-polynomial-protos'…
BenHenning Jan 19, 2022
fca0cd9
Add parameterized test runner.
BenHenning Jan 21, 2022
83e800c
Add & update tests.
BenHenning Jan 21, 2022
3fa8dad
Lint fixes.
BenHenning Jan 21, 2022
87a41db
Remove internals that broke things.
BenHenning Jan 21, 2022
c0172ce
Add regex exemptions.
BenHenning Jan 21, 2022
8723ee8
Merge branch 'add-support-for-math-expressions-pt6-tokenizer' into ad…
BenHenning Jan 21, 2022
ff41eeb
Post-merge fix.
BenHenning Jan 21, 2022
f5b6571
Add error tests.
BenHenning Jan 22, 2022
b7ac054
Finish algebraic equation tests.
BenHenning Jan 22, 2022
a122515
Reimplement numeric expression tests.
BenHenning Jan 22, 2022
984e740
Finish algebraic expression tests.
BenHenning Jan 22, 2022
042a1ad
Add missing tests for better coverage.
BenHenning Jan 24, 2022
8ead9bf
Add KDocs & test exemptions.
BenHenning Jan 25, 2022
aeec35c
Lint fixes.
BenHenning Jan 25, 2022
57e6f5b
Remove temporary TODOs.
BenHenning Jan 25, 2022
10eac78
Merge branch 'add-support-for-math-expressions-pt7-math-expression-pa…
BenHenning Jan 25, 2022
07be596
Add tests.
BenHenning Jan 26, 2022
19a6425
Split StringToFractionParser.
BenHenning Jan 26, 2022
444d3d0
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Jan 26, 2022
cb5c5d1
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Jan 27, 2022
7a364c3
Address reviewer comments + other stuff.
BenHenning Jan 27, 2022
2c0b9cd
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Jan 27, 2022
4364d7f
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Jan 27, 2022
cfe6cab
Move StringExtensions & fraction parsing.
BenHenning Jan 27, 2022
5e83a33
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Jan 27, 2022
c6cf5f5
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Jan 27, 2022
73dccd8
Address reviewer comments.
BenHenning Jan 27, 2022
b7535fa
Alphabetize test exemptions.
BenHenning Jan 27, 2022
f4cd6cd
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Jan 27, 2022
574ebb8
Merge branch 'add-support-for-math-expressions-pt5-polynomial-protos'…
BenHenning Jan 27, 2022
a00164c
Fix typo & add regex check.
BenHenning Jan 27, 2022
0287f19
Add missing KDocs.
BenHenning Jan 27, 2022
75103d5
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Jan 27, 2022
52d2605
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Jan 27, 2022
37dbc85
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Jan 27, 2022
385d2d3
Merge branch 'add-support-for-math-expressions-pt5-polynomial-protos'…
BenHenning Jan 27, 2022
4bacc8a
Merge branch 'add-support-for-math-expressions-pt6-tokenizer' into ad…
BenHenning Jan 27, 2022
1e5279d
Post-merge cleanups.
BenHenning Jan 27, 2022
bbf7e2d
Add new test for negation with math symbol.
BenHenning Jan 27, 2022
cf72c8d
Merge branch 'add-support-for-math-expressions-pt7-math-expression-pa…
BenHenning Jan 27, 2022
ba4128c
Post-merge fixes.
BenHenning Jan 27, 2022
fd09758
Add KDocs.
BenHenning Jan 27, 2022
01c2326
Refactor & simplify real ext impl.
BenHenning Jan 27, 2022
98d6939
Lint fixes.
BenHenning Jan 28, 2022
928aa6f
Merge branch 'add-support-for-math-expressions-pt8-latex-conversion-a…
BenHenning Jan 28, 2022
ca412f7
Simplify operation list converter a lot.
BenHenning Jan 28, 2022
f172bcf
Prepare for new tests.
BenHenning Jan 28, 2022
65a9fe1
Remove the ComparableOperationList wrapper.
BenHenning Jan 28, 2022
fa4de34
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Jan 28, 2022
e2d226f
Merge branch 'add-support-for-math-expressions-pt5-polynomial-protos'…
BenHenning Jan 28, 2022
fbd935c
Change parameterized method delimiter.
BenHenning Jan 28, 2022
5b6d1f2
Merge branch 'add-support-for-math-expressions-pt6-tokenizer' into ad…
BenHenning Jan 28, 2022
fd11a79
Merge branch 'add-support-for-math-expressions-pt7-math-expression-pa…
BenHenning Jan 28, 2022
8420c56
Use utility directly in test.
BenHenning Jan 28, 2022
047645c
Merge branch 'add-support-for-math-expressions-pt8-latex-conversion-a…
BenHenning Jan 28, 2022
b8a3e2e
Post-merge fixes.
BenHenning Jan 28, 2022
28811b3
Add first round of tests.
BenHenning Jan 28, 2022
b400176
Finish initial test suite.
BenHenning Jan 29, 2022
e6c09d8
Simplify operation sorting comparators.
BenHenning Jan 29, 2022
bebc100
Remove old tests.
BenHenning Jan 29, 2022
3cecc6c
Add remaining missing tests.
BenHenning Jan 29, 2022
573fee9
KDocs & test exemption.
BenHenning Jan 29, 2022
1970f34
Renames & lint fixes.
BenHenning Jan 29, 2022
f5abb4d
Merge branch 'add-support-for-math-expressions-pt9-commutative-compar…
BenHenning Jan 29, 2022
45b6099
Post-merge fixes.
BenHenning Jan 29, 2022
76a7887
Add tests.
BenHenning Feb 2, 2022
06ba279
KDocs + exemptions.
BenHenning Feb 2, 2022
ad3091d
Lint fixes.
BenHenning Feb 2, 2022
576d7dc
Merge branch 'add-support-for-math-expressions-pt10-polynomials' into…
BenHenning Feb 2, 2022
b8ce188
Post-merge fixes.
BenHenning Feb 2, 2022
468b565
Add extension tests.
BenHenning Feb 4, 2022
4030aa3
Add classifier tests.
BenHenning Feb 4, 2022
d20256c
Use more intentional epsilons for float comparing.
BenHenning Feb 4, 2022
cdaf778
Merge branch 'add-support-for-math-expressions-pt5-polynomial-protos'…
BenHenning Feb 4, 2022
7e97d0b
Treat en-dash as a subtraction symbol.
BenHenning Feb 4, 2022
a9c68b1
Add explicit platform selection for paramerized.
BenHenning Feb 5, 2022
a273ee6
Exemption fixes.
BenHenning Feb 5, 2022
924214d
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Feb 5, 2022
686c4b6
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Feb 5, 2022
1a3cba5
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Feb 5, 2022
bff824e
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Feb 5, 2022
90b05bf
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Feb 5, 2022
09e2aad
Remove failing test.
BenHenning Feb 5, 2022
c7c2e4b
Merge branch 'add-support-for-math-expressions-pt5-polynomial-protos'…
BenHenning Feb 5, 2022
8bdf183
Merge branch 'add-support-for-math-expressions-pt6-tokenizer' into ad…
BenHenning Feb 5, 2022
b48d06a
Fix unary expression precedence.
BenHenning Feb 5, 2022
8ac22cb
Fixes & add more test cases.
BenHenning Feb 5, 2022
cdee008
Merge branch 'add-support-for-math-expressions-pt7-math-expression-pa…
BenHenning Feb 5, 2022
476e604
Post-merge fixes & test changes.
BenHenning Feb 5, 2022
5ed0013
Use utility directly in LaTeX tests.
BenHenning Feb 5, 2022
370dcf6
Merge branch 'add-support-for-math-expressions-pt8-latex-conversion-a…
BenHenning Feb 5, 2022
c16db64
Post-merge fixes.
BenHenning Feb 5, 2022
df4221f
Merge branch 'add-support-for-math-expressions-pt9-commutative-compar…
BenHenning Feb 5, 2022
dab330e
Post-merge fixes.
BenHenning Feb 5, 2022
7567232
Merge branch 'add-support-for-math-expressions-pt10-polynomials' into…
BenHenning Feb 5, 2022
9c70c31
Post-merge fixes.
BenHenning Feb 5, 2022
3248e84
Lint & other check fixes.
BenHenning Feb 5, 2022
43cc4e0
Merge branch 'add-support-for-math-expressions-pt11-numeric-expressio…
BenHenning Feb 5, 2022
3960220
Replace deprecated term.
BenHenning Feb 5, 2022
528e9f7
Merge branch 'add-support-for-math-expressions-pt11-numeric-expressio…
BenHenning Feb 5, 2022
f7ec751
Post-merge fixes.
BenHenning Feb 5, 2022
782e058
Add full test suites for alg exp classifiers.
BenHenning Feb 5, 2022
0a7cb69
Lint & static check fixes.
BenHenning Feb 5, 2022
fd0c0cc
Fix test on Gradle.
BenHenning Feb 5, 2022
2839e7b
Merge branch 'add-support-for-math-expressions-pt11-numeric-expressio…
BenHenning Feb 5, 2022
812b66e
Fix test for Gradle.
BenHenning Feb 5, 2022
5035277
Merge branch 'add-support-for-math-expressions-pt12-algebraic-express…
BenHenning Feb 5, 2022
d811636
Add tests for math equations.
BenHenning Feb 5, 2022
0c00467
Static check & lint fixes.
BenHenning Feb 5, 2022
89de734
Merge branch 'add-support-for-math-expressions-pt13-math-equation-inp…
BenHenning Feb 5, 2022
d026506
Post-merge fixes.
BenHenning Feb 5, 2022
cddd3b5
Merge branch 'add-support-for-math-expressions-pt14-enable-math-class…
BenHenning Feb 5, 2022
c4d53dd
Split up tests.
BenHenning Feb 5, 2022
15d9d25
Add missing test in Bazel, and fix it.
BenHenning Feb 7, 2022
b63883e
Correct order for genrule.
BenHenning Feb 7, 2022
8562393
Merge branch 'add-support-for-math-expressions-pt14-enable-math-class…
BenHenning Feb 7, 2022
0642757
Add full test suite.
BenHenning Feb 8, 2022
4c163bf
Clean up + KDocs + exemption.
BenHenning Feb 8, 2022
01b1832
Lint fixes.
BenHenning Feb 8, 2022
ecc836e
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Feb 18, 2022
b183d67
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Feb 18, 2022
005d9a0
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Feb 18, 2022
ba198fd
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Feb 18, 2022
1f2b90d
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Feb 18, 2022
86e90f7
Merge branch 'add-support-for-math-expressions-pt5-polynomial-protos'…
BenHenning Feb 18, 2022
a6dc7d4
Address reviewer comment.
BenHenning Feb 18, 2022
a6d1111
Merge branch 'add-support-for-math-expressions-pt6-tokenizer' into ad…
BenHenning Feb 18, 2022
64a1b55
Merge branch 'add-support-for-math-expressions-pt7-math-expression-pa…
BenHenning Feb 18, 2022
151e0bf
Merge branch 'add-support-for-math-expressions-pt8-latex-conversion-a…
BenHenning Feb 18, 2022
fd9ec1f
Fix broken build.
BenHenning Feb 18, 2022
960287d
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Feb 18, 2022
b85567e
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Feb 18, 2022
2ed67c5
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Feb 18, 2022
3744cf2
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Feb 18, 2022
c57e792
Merge branch 'add-support-for-math-expressions-pt5-polynomial-protos'…
BenHenning Feb 18, 2022
056f547
Merge branch 'add-support-for-math-expressions-pt6-tokenizer' into ad…
BenHenning Feb 18, 2022
5431e27
Merge branch 'add-support-for-math-expressions-pt7-math-expression-pa…
BenHenning Feb 18, 2022
829bb16
Merge branch 'add-support-for-math-expressions-pt8-latex-conversion-a…
BenHenning Feb 18, 2022
23254ca
Merge branch 'add-support-for-math-expressions-pt9-commutative-compar…
BenHenning Feb 18, 2022
0fc8a1b
Fix broken build post-merge.
BenHenning Feb 18, 2022
e4b92e5
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Feb 18, 2022
9eb1c2d
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Feb 18, 2022
1f3fb48
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Feb 18, 2022
24ac61c
Merge branch 'add-support-for-math-expressions-pt5-polynomial-protos'…
BenHenning Feb 18, 2022
c74aee0
Merge branch 'add-support-for-math-expressions-pt6-tokenizer' into ad…
BenHenning Feb 18, 2022
e814df8
Merge branch 'add-support-for-math-expressions-pt7-math-expression-pa…
BenHenning Feb 18, 2022
6df7a21
Merge branch 'add-support-for-math-expressions-pt8-latex-conversion-a…
BenHenning Feb 18, 2022
446d263
Merge branch 'add-support-for-math-expressions-pt9-commutative-compar…
BenHenning Feb 18, 2022
3cd065f
Merge branch 'add-support-for-math-expressions-pt10-polynomials' into…
BenHenning Feb 18, 2022
c59598c
Fix broken post-merge classifier.
BenHenning Feb 18, 2022
41be40e
Address reviewer comment.
BenHenning Feb 18, 2022
8070cb6
Merge branch 'add-support-for-math-expressions-pt11-numeric-expressio…
BenHenning Feb 18, 2022
1ea2241
Post-merge build fixes.
BenHenning Feb 18, 2022
6bf8006
Merge branch 'add-support-for-math-expressions-pt12-algebraic-express…
BenHenning Feb 18, 2022
3407bf4
Post-merge build fixes for new classifiers.
BenHenning Feb 18, 2022
337a195
Merge branch 'add-support-for-math-expressions-pt13-math-equation-inp…
BenHenning Feb 18, 2022
4328d56
Post-merge build fixes.
BenHenning Feb 18, 2022
7e6fc7d
Merge branch 'add-support-for-math-expressions-pt14-enable-math-class…
BenHenning Feb 18, 2022
0e9402a
Correct reference document link.
BenHenning Feb 18, 2022
c01f939
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Feb 24, 2022
14f7057
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Feb 24, 2022
b98e1ec
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Feb 24, 2022
b50c40f
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Feb 24, 2022
6d0cc9e
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Feb 24, 2022
2217f7d
Merge branch 'add-support-for-math-expressions-pt5-polynomial-protos'…
BenHenning Feb 24, 2022
a9adda1
Merge branch 'add-support-for-math-expressions-pt6-tokenizer' into ad…
BenHenning Feb 24, 2022
ac63847
Merge branch 'add-support-for-math-expressions-pt7-math-expression-pa…
BenHenning Feb 24, 2022
3f236cb
Merge branch 'add-support-for-math-expressions-pt8-latex-conversion-a…
BenHenning Feb 24, 2022
7a76b98
Merge branch 'add-support-for-math-expressions-pt9-commutative-compar…
BenHenning Feb 24, 2022
af86921
Merge branch 'add-support-for-math-expressions-pt10-polynomials' into…
BenHenning Feb 24, 2022
ebac9b3
Merge branch 'add-support-for-math-expressions-pt11-numeric-expressio…
BenHenning Feb 24, 2022
ba460f5
Merge branch 'add-support-for-math-expressions-pt12-algebraic-express…
BenHenning Feb 24, 2022
a2359e4
Merge branch 'add-support-for-math-expressions-pt13-math-equation-inp…
BenHenning Feb 24, 2022
db99c80
Merge branch 'add-support-for-math-expressions-pt14-enable-math-class…
BenHenning Feb 24, 2022
8691e43
Add and fix missing test (was broken on Gradle).
BenHenning Feb 24, 2022
000d88d
Merge branch 'add-support-for-math-expressions-pt14-enable-math-class…
BenHenning Feb 24, 2022
1d74aed
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Mar 7, 2022
2ae10ec
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Mar 7, 2022
60670a5
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Mar 7, 2022
473b562
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Mar 7, 2022
73a052f
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Mar 7, 2022
e35b13f
Merge branch 'add-support-for-math-expressions-pt5-polynomial-protos'…
BenHenning Mar 7, 2022
9aa8315
Merge branch 'add-support-for-math-expressions-pt6-tokenizer' into ad…
BenHenning Mar 7, 2022
e8b8f9f
Merge branch 'add-support-for-math-expressions-pt7-math-expression-pa…
BenHenning Mar 7, 2022
a28d87f
Merge branch 'add-support-for-math-expressions-pt8-latex-conversion-a…
BenHenning Mar 7, 2022
9c7a1cb
Merge branch 'add-support-for-math-expressions-pt9-commutative-compar…
BenHenning Mar 7, 2022
3a69df4
Merge branch 'add-support-for-math-expressions-pt10-polynomials' into…
BenHenning Mar 7, 2022
a632215
Merge branch 'add-support-for-math-expressions-pt11-numeric-expressio…
BenHenning Mar 7, 2022
4c32610
Merge branch 'add-support-for-math-expressions-pt12-algebraic-express…
BenHenning Mar 7, 2022
523cdcb
Merge branch 'add-support-for-math-expressions-pt13-math-equation-inp…
BenHenning Mar 7, 2022
66ed496
Merge branch 'add-support-for-math-expressions-pt14-enable-math-class…
BenHenning Mar 7, 2022
8945c3a
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Mar 17, 2022
391cf22
Post-merge fix.
BenHenning Mar 17, 2022
7918001
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Mar 17, 2022
c29a47c
More post-merge fixes.
BenHenning Mar 17, 2022
19b3800
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Mar 17, 2022
aa4fd38
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Mar 17, 2022
eb2bcc3
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Mar 17, 2022
8bd314f
Merge branch 'add-support-for-math-expressions-pt5-polynomial-protos'…
BenHenning Mar 17, 2022
429ee02
Merge branch 'add-support-for-math-expressions-pt6-tokenizer' into ad…
BenHenning Mar 17, 2022
445664a
Fix TODO comment.
BenHenning Mar 17, 2022
b82b158
Merge branch 'add-support-for-math-expressions-pt7-math-expression-pa…
BenHenning Mar 17, 2022
4dd551b
Merge branch 'add-support-for-math-expressions-pt8-latex-conversion-a…
BenHenning Mar 17, 2022
4b9b9ac
Merge branch 'add-support-for-math-expressions-pt9-commutative-compar…
BenHenning Mar 17, 2022
af405aa
Merge branch 'add-support-for-math-expressions-pt10-polynomials' into…
BenHenning Mar 17, 2022
5d797b0
Merge branch 'add-support-for-math-expressions-pt11-numeric-expressio…
BenHenning Mar 17, 2022
89361ed
Merge branch 'add-support-for-math-expressions-pt12-algebraic-express…
BenHenning Mar 17, 2022
2ef6688
Merge branch 'add-support-for-math-expressions-pt13-math-equation-inp…
BenHenning Mar 17, 2022
85d8933
Merge branch 'add-support-for-math-expressions-pt14-enable-math-class…
BenHenning Mar 17, 2022
52862d6
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Mar 25, 2022
cd31247
Merge branch 'develop' into add-support-for-math-expressions-pt1-fix-…
BenHenning Mar 25, 2022
4dbd838
Merge branch 'add-support-for-math-expressions-pt1-fix-proto-imports'…
BenHenning Mar 25, 2022
deabf3a
Merge branch 'develop' into add-support-for-math-expressions-pt2-math…
BenHenning Mar 26, 2022
8bd89e6
Merge branch 'add-support-for-math-expressions-pt2-math-utility-refac…
BenHenning Mar 26, 2022
06f9cfd
Merge branch 'develop' into add-support-for-math-expressions-pt3-math…
BenHenning Mar 26, 2022
a1284a1
Merge branch 'add-support-for-math-expressions-pt3-math-expression-pr…
BenHenning Mar 26, 2022
2c2328b
Merge branch 'develop' into add-support-for-math-expressions-pt4-comm…
BenHenning Mar 26, 2022
feb901b
Merge branch 'add-support-for-math-expressions-pt4-commutative-compar…
BenHenning Mar 26, 2022
783aaf0
Merge branch 'develop' into add-support-for-math-expressions-pt5-poly…
BenHenning Mar 26, 2022
7306faa
Merge branch 'add-support-for-math-expressions-pt5-polynomial-protos'…
BenHenning Mar 26, 2022
d59437c
Merge branch 'develop' into add-support-for-math-expressions-pt6-toke…
BenHenning Mar 26, 2022
be04055
Merge branch 'add-support-for-math-expressions-pt6-tokenizer' into ad…
BenHenning Mar 26, 2022
88ecf9e
Merge branch 'develop' into add-support-for-math-expressions-pt7-math…
BenHenning Mar 26, 2022
7cb991a
Merge branch 'add-support-for-math-expressions-pt7-math-expression-pa…
BenHenning Mar 26, 2022
b94f94f
Merge branch 'develop' into add-support-for-math-expressions-pt8-late…
BenHenning Mar 26, 2022
3229bae
Merge branch 'add-support-for-math-expressions-pt8-latex-conversion-a…
BenHenning Mar 26, 2022
d31a403
Merge branch 'develop' into add-support-for-math-expressions-pt9-comm…
BenHenning Mar 26, 2022
67c53ec
Merge branch 'add-support-for-math-expressions-pt9-commutative-compar…
BenHenning Mar 26, 2022
ff2df48
Merge branch 'develop' into add-support-for-math-expressions-pt10-pol…
BenHenning Mar 26, 2022
c41bda8
Merge branch 'add-support-for-math-expressions-pt10-polynomials' into…
BenHenning Mar 26, 2022
e34c52a
Merge branch 'develop' into add-support-for-math-expressions-pt11-num…
BenHenning Mar 26, 2022
78935c3
Merge branch 'add-support-for-math-expressions-pt11-numeric-expressio…
BenHenning Mar 26, 2022
9271db4
Merge branch 'develop' into add-support-for-math-expressions-pt12-alg…
BenHenning Mar 26, 2022
3c0dbff
Merge branch 'add-support-for-math-expressions-pt12-algebraic-express…
BenHenning Mar 26, 2022
d29b349
Merge branch 'develop' into add-support-for-math-expressions-pt13-mat…
BenHenning Mar 26, 2022
52de127
Merge branch 'add-support-for-math-expressions-pt13-math-equation-inp…
BenHenning Mar 26, 2022
c4beb96
Merge branch 'develop' into add-support-for-math-expressions-pt14-ena…
BenHenning Mar 27, 2022
1bf3c1a
Merge branch 'add-support-for-math-expressions-pt14-enable-math-class…
BenHenning Mar 27, 2022
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
4 changes: 4 additions & 0 deletions app/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@ TEST_DEPS = [
":test_deps",
"//app/src/main/java/org/oppia/android/app/testing/activity:test_activity",
"//app/src/main/java/org/oppia/android/app/translation/testing:test_module",
"//app/src/main/java/org/oppia/android/app/utility/math:math_expression_accessibility_util",
"//domain",
"//domain/src/main/java/org/oppia/android/domain/audio:audio_player_controller",
"//domain/src/main/java/org/oppia/android/domain/classify/rules/algebraicexpressioninput:algebraic_expression_input_rule_module",
Expand All @@ -851,6 +852,8 @@ TEST_DEPS = [
"//testing/src/main/java/org/oppia/android/testing/espresso:konfetti_view_matcher",
"//testing/src/main/java/org/oppia/android/testing/espresso:text_input_action",
"//testing/src/main/java/org/oppia/android/testing/junit:initialize_default_locale_rule",
"//testing/src/main/java/org/oppia/android/testing/math:math_equation_subject",
"//testing/src/main/java/org/oppia/android/testing/math:math_expression_subject",
"//testing/src/main/java/org/oppia/android/testing/mockito",
"//testing/src/main/java/org/oppia/android/testing/network",
"//testing/src/main/java/org/oppia/android/testing/network:test_module",
Expand Down Expand Up @@ -886,6 +889,7 @@ TEST_DEPS = [
"//utility/src/main/java/org/oppia/android/util/accessibility:test_module",
"//utility/src/main/java/org/oppia/android/util/caching:asset_prod_module",
"//utility/src/main/java/org/oppia/android/util/caching/testing:caching_test_module",
"//utility/src/main/java/org/oppia/android/util/math:math_expression_parser",
"//utility/src/main/java/org/oppia/android/util/parser/html:custom_bullet_span",
"//utility/src/main/java/org/oppia/android/util/parser/html:html_parser",
"//utility/src/main/java/org/oppia/android/util/parser/html:html_parser_entity_type_module",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ kt_android_library(
deps = [
"//app/src/main/java/org/oppia/android/app/activity:activity_intent_factories_shim",
"//app/src/main/java/org/oppia/android/app/activity:injectable_app_compat_activity",
"//app/src/main/java/org/oppia/android/app/utility/math:math_expression_accessibility_util",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.oppia.android.app.activity.InjectableAppCompatActivity
import org.oppia.android.app.translation.AppLanguageResourceHandler
import org.oppia.android.app.translation.AppLanguageWatcherMixin
import org.oppia.android.app.utility.datetime.DateTimeUtil
import org.oppia.android.app.utility.math.MathExpressionAccessibilityUtil
import javax.inject.Inject

// TODO(#3830): Migrate all test activities over to using this test activity & make this closed.
Expand Down Expand Up @@ -36,6 +37,9 @@ open class TestActivity : InjectableAppCompatActivity() {
@Inject
lateinit var appLanguageWatcherMixin: AppLanguageWatcherMixin

@Inject
lateinit var mathExpressionAccessibilityUtil: MathExpressionAccessibilityUtil

override fun attachBaseContext(newBase: Context?) {
super.attachBaseContext(newBase)
(activityComponent as Injector).inject(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ class AppLanguageResourceHandler @Inject constructor(
}
}

/** See [OppiaLocale.DisplayLocale.formatLong] for specific behavior. */
fun formatLong(value: Long): String = getDisplayLocale().formatLong(value)

/** See [OppiaLocale.DisplayLocale.formatDouble] for specific behavior. */
fun formatDouble(value: Double): String = getDisplayLocale().formatDouble(value)

/** See [OppiaLocale.DisplayLocale.computeDateString]. */
fun computeDateString(timestampMillis: Long): String =
getDisplayLocale().computeDateString(timestampMillis)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""
General purposes utilities corresponding to displaying math expressions & constructs.
"""

load("@dagger//:workspace_defs.bzl", "dagger_rules")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")

# Resource shim needed so that MathExpressionAccessibilityUtil can build in both Gradle & Bazel.
genrule(
name = "update_MathExpressionAccessibilityUtil",
srcs = ["MathExpressionAccessibilityUtil.kt"],
outs = ["MathExpressionAccessibilityUtil_updated.kt"],
cmd = """
cat $(SRCS) |
sed 's/import org.oppia.android.R/import org.oppia.android.app.R/g' > $(OUTS)
""",
)

kt_android_library(
name = "math_expression_accessibility_util",
srcs = [
"MathExpressionAccessibilityUtil_updated.kt",
],
visibility = ["//app:app_visibility"],
deps = [
":dagger",
"//app:resources",
"//app/src/main/java/org/oppia/android/app/translation:app_language_resource_handler",
"//model/src/main/proto:languages_java_proto_lite",
"//model/src/main/proto:math_java_proto_lite",
"//utility/src/main/java/org/oppia/android/util/math:extensions",
],
)

dagger_rules()
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
package org.oppia.android.app.utility.math

import org.oppia.android.R
import org.oppia.android.app.model.MathBinaryOperation
import org.oppia.android.app.model.MathBinaryOperation.Operator.ADD
import org.oppia.android.app.model.MathBinaryOperation.Operator.DIVIDE
import org.oppia.android.app.model.MathBinaryOperation.Operator.EXPONENTIATE
import org.oppia.android.app.model.MathBinaryOperation.Operator.MULTIPLY
import org.oppia.android.app.model.MathBinaryOperation.Operator.SUBTRACT
import org.oppia.android.app.model.MathEquation
import org.oppia.android.app.model.MathExpression
import org.oppia.android.app.model.MathExpression.ExpressionTypeCase.BINARY_OPERATION
import org.oppia.android.app.model.MathExpression.ExpressionTypeCase.CONSTANT
import org.oppia.android.app.model.MathExpression.ExpressionTypeCase.EXPRESSIONTYPE_NOT_SET
import org.oppia.android.app.model.MathExpression.ExpressionTypeCase.FUNCTION_CALL
import org.oppia.android.app.model.MathExpression.ExpressionTypeCase.GROUP
import org.oppia.android.app.model.MathExpression.ExpressionTypeCase.UNARY_OPERATION
import org.oppia.android.app.model.MathExpression.ExpressionTypeCase.VARIABLE
import org.oppia.android.app.model.MathFunctionCall.FunctionType
import org.oppia.android.app.model.MathFunctionCall.FunctionType.FUNCTION_UNSPECIFIED
import org.oppia.android.app.model.MathFunctionCall.FunctionType.SQUARE_ROOT
import org.oppia.android.app.model.MathUnaryOperation.Operator.NEGATE
import org.oppia.android.app.model.MathUnaryOperation.Operator.POSITIVE
import org.oppia.android.app.model.OppiaLanguage
import org.oppia.android.app.model.OppiaLanguage.ARABIC
import org.oppia.android.app.model.OppiaLanguage.BRAZILIAN_PORTUGUESE
import org.oppia.android.app.model.OppiaLanguage.ENGLISH
import org.oppia.android.app.model.OppiaLanguage.HINDI
import org.oppia.android.app.model.OppiaLanguage.HINGLISH
import org.oppia.android.app.model.OppiaLanguage.LANGUAGE_UNSPECIFIED
import org.oppia.android.app.model.OppiaLanguage.PORTUGUESE
import org.oppia.android.app.model.OppiaLanguage.UNRECOGNIZED
import org.oppia.android.app.model.Real.RealTypeCase.INTEGER
import org.oppia.android.app.model.Real.RealTypeCase.IRRATIONAL
import org.oppia.android.app.model.Real.RealTypeCase.RATIONAL
import org.oppia.android.app.model.Real.RealTypeCase.REALTYPE_NOT_SET
import org.oppia.android.app.translation.AppLanguageResourceHandler
import javax.inject.Inject
import org.oppia.android.app.model.MathBinaryOperation.Operator as BinaryOperator
import org.oppia.android.app.model.MathUnaryOperation.Operator as UnaryOperator

/**
* Utility for computing an accessibility string for screenreaders to be able to read out parsed
* [MathExpression]s and [MathEquation]s.
*
* See [convertToHumanReadableString] for the specific function.
*/
class MathExpressionAccessibilityUtil @Inject constructor(
private val resourceHandler: AppLanguageResourceHandler
) {
/**
* Returns the human-readable string (for screenreaders) representation of the specified
* [expression].
*
* Note that rational ``Real``s are specifically not supported and will result in a null value
* being returned (for custom expression constructs should use a division operation and set
* [divAsFraction] to true. Further, irrational reals may be rounded during formatting if they are
* very large or have long decimals (for an easier time reading). Numbers will be formatted
* according to the user's locale.
*
* @param expression the expression to convert
* @param language the target language for which the expression should be generated
* @param divAsFraction whether divisions should be read out as fractions rather than divisions
* @return the human-readable string, or null if the expression is malformed or the target
* language is unsupported
*/
fun convertToHumanReadableString(
expression: MathExpression,
language: OppiaLanguage,
divAsFraction: Boolean
): String? {
return when (language) {
ENGLISH -> expression.toHumanReadableEnglishString(divAsFraction)
ARABIC, HINDI, HINGLISH, PORTUGUESE, BRAZILIAN_PORTUGUESE, LANGUAGE_UNSPECIFIED,
UNRECOGNIZED -> null
}
}

/**
* Returns the human-readable string (for screenreaders) representation of the specified
* [equation].
*
* This function behaves in the same way as the [MathExpression] version of
* [convertToHumanReadableString]--see that method's documentation for more details.
*/
fun convertToHumanReadableString(
equation: MathEquation,
language: OppiaLanguage,
divAsFraction: Boolean
): String? {
return when (language) {
ENGLISH -> equation.toHumanReadableEnglishString(divAsFraction)
ARABIC, HINDI, HINGLISH, PORTUGUESE, BRAZILIAN_PORTUGUESE, LANGUAGE_UNSPECIFIED,
UNRECOGNIZED -> null
}
}

private fun MathEquation.toHumanReadableEnglishString(divAsFraction: Boolean): String? {
val lhsStr = leftSide.toHumanReadableEnglishString(divAsFraction)
val rhsStr = rightSide.toHumanReadableEnglishString(divAsFraction)
return if (lhsStr != null && rhsStr != null) {
resourceHandler.getStringInLocaleWithWrapping(
R.string.math_accessibility_a_equals_b, lhsStr, rhsStr
)
} else null
}

private fun MathExpression.toHumanReadableEnglishString(divAsFraction: Boolean): String? {
// Ref: https://docs.google.com/document/d/1SkzAD4k7SWLp5_3L5WNxsnR79ATlOk8pz4irfE2ls-4/view.

// Note that extra bidi wrapping is occurring here since there's not an obvious way to wrap "at
// the end" for non-equations.
return when (expressionTypeCase) {
CONSTANT -> when (constant.realTypeCase) {
IRRATIONAL -> resourceHandler.formatDouble(constant.irrational)
INTEGER -> resourceHandler.formatLong(constant.integer.toLong())
// Note that rational types should not actually be encountered in raw expressions, so
// there's no explicit support for reading them out.
RATIONAL, REALTYPE_NOT_SET, null -> null
}
VARIABLE -> when (variable) {
"z", "Z" -> {
val zed =
resourceHandler.getStringInLocale(R.string.math_accessibility_part_zed)
if (variable == "Z") {
resourceHandler.capitalizeForHumans(zed)
} else zed
}
else -> variable
}
BINARY_OPERATION -> {
val lhs = binaryOperation.leftOperand
val rhs = binaryOperation.rightOperand
val lhsStr = lhs.toHumanReadableEnglishString(divAsFraction)
val rhsStr = rhs.toHumanReadableEnglishString(divAsFraction)
if (lhsStr == null || rhsStr == null) return null
when (binaryOperation.operator) {
ADD -> {
resourceHandler.getStringInLocaleWithWrapping(
R.string.math_accessibility_a_plus_b, lhsStr, rhsStr
)
}
SUBTRACT -> {
resourceHandler.getStringInLocaleWithWrapping(
R.string.math_accessibility_a_minus_b, lhsStr, rhsStr
)
}
MULTIPLY -> {
val strResId = if (binaryOperation.canBeReadAsImplicitMultiplication()) {
R.string.math_accessibility_implicit_multiplication
} else R.string.math_accessibility_a_times_b
resourceHandler.getStringInLocaleWithWrapping(strResId, lhsStr, rhsStr)
}
DIVIDE -> when {
divAsFraction -> when {
binaryOperation.isOneHalf() -> {
resourceHandler.getStringInLocaleWithWrapping(
R.string.math_accessibility_part_one_half
)
}
binaryOperation.isSimpleFraction() -> {
resourceHandler.getStringInLocaleWithWrapping(
R.string.math_accessibility_simple_fraction, lhsStr, rhsStr
)
}
else -> {
resourceHandler.getStringInLocaleWithWrapping(
R.string.math_accessibility_complex_fraction, lhsStr, rhsStr
)
}
}
else -> {
resourceHandler.getStringInLocaleWithWrapping(
R.string.math_accessibility_a_divides_b, lhsStr, rhsStr
)
}
}
EXPONENTIATE -> {
resourceHandler.getStringInLocaleWithWrapping(
R.string.math_accessibility_a_exp_b, lhsStr, rhsStr
)
}
BinaryOperator.OPERATOR_UNSPECIFIED, BinaryOperator.UNRECOGNIZED, null -> null
}
}
UNARY_OPERATION -> {
val operandStr = unaryOperation.operand.toHumanReadableEnglishString(divAsFraction)
when (unaryOperation.operator) {
NEGATE -> operandStr?.let {
resourceHandler.getStringInLocaleWithWrapping(
R.string.math_accessibility_negative_a, it
)
}
POSITIVE -> operandStr?.let {
resourceHandler.getStringInLocaleWithWrapping(
R.string.math_accessibility_positive_a, it
)
}
UnaryOperator.OPERATOR_UNSPECIFIED, UnaryOperator.UNRECOGNIZED, null -> null
}
}
FUNCTION_CALL -> {
val argStr = functionCall.argument.toHumanReadableEnglishString(divAsFraction)
when (functionCall.functionType) {
SQUARE_ROOT -> argStr?.let {
if (functionCall.argument.isSingleTerm()) {
resourceHandler.getStringInLocaleWithWrapping(
R.string.math_accessibility_simple_square_root, it
)
} else {
resourceHandler.getStringInLocaleWithWrapping(
R.string.math_accessibility_complex_square_root, it
)
}
}
FUNCTION_UNSPECIFIED, FunctionType.UNRECOGNIZED, null -> null
}
}
GROUP -> group.toHumanReadableEnglishString(divAsFraction)?.let {
if (!isSingleTerm()) {
resourceHandler.getStringInLocaleWithWrapping(R.string.math_accessibility_group, it)
} else it
}
EXPRESSIONTYPE_NOT_SET, null -> null
}
}

private companion object {
private fun MathBinaryOperation.canBeReadAsImplicitMultiplication(): Boolean {
// Note that exponentiation is specialized since it's higher precedence than multiplication
// which means the graph won't look like "constant * variable" for polynomial terms like 2x^4
// (which are cases the system should read using implicit multiplication, e.g. "two x raised
// to the power of 4").
if (!isImplicit || !leftOperand.isConstant()) return false
return rightOperand.isVariable() || rightOperand.isExponentiation()
}

private fun MathBinaryOperation.isSimpleFraction(): Boolean {
// 'Simple' fractions are those with single term numerators and denominators (which are
// subsequently easier to read out), and whose constant numerator/denonominators are integers.
return leftOperand.isSimpleFractionTerm() && rightOperand.isSimpleFractionTerm()
}

private fun MathBinaryOperation.isOneHalf(): Boolean {
// If the either operand isn't an integer it will default to 0 per proto3 rules.
return leftOperand.constant.integer == 1 && rightOperand.constant.integer == 2
}

private fun MathExpression.isConstant(): Boolean = expressionTypeCase == CONSTANT

private fun MathExpression.isVariable(): Boolean = expressionTypeCase == VARIABLE

private fun MathExpression.isExponentiation(): Boolean =
expressionTypeCase == BINARY_OPERATION && binaryOperation.operator == EXPONENTIATE

private fun MathExpression.isSingleTerm(): Boolean = when (expressionTypeCase) {
CONSTANT, VARIABLE, FUNCTION_CALL -> true
BINARY_OPERATION, UNARY_OPERATION -> false
GROUP -> group.isSingleTerm()
EXPRESSIONTYPE_NOT_SET, null -> false
}

private fun MathExpression.isSimpleFractionTerm(): Boolean = when (expressionTypeCase) {
CONSTANT -> constant.realTypeCase == INTEGER
VARIABLE -> true
BINARY_OPERATION, UNARY_OPERATION, FUNCTION_CALL, GROUP, EXPRESSIONTYPE_NOT_SET, null -> false
}
}
}
17 changes: 17 additions & 0 deletions app/src/main/res/values/untranslated_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,21 @@
<string name="learner_analytics_sync_status_data_uploading" translatable="false">Profile data is currently uploading…</string>
<string name="learner_analytics_sync_status_data_uploaded" translatable="false">All profile data has been uploaded.</string>
<string name="learner_analytics_sync_status_network_error" translatable="false">Please connect to a WiFi or Cellular network in order to upload profile data.</string>
<!-- Accessibility string generation for math expressions. Note that these are in lowercase on purpose. -->
<string name="math_accessibility_part_zed" translatable="false">zed</string>
<string name="math_accessibility_part_one_half" translatable="false">one half</string>
<string name="math_accessibility_a_equals_b" translatable="false">%s equals %s</string>
<string name="math_accessibility_a_plus_b" translatable="false">%s plus %s</string>
<string name="math_accessibility_a_minus_b" translatable="false">%s minus %s</string>
<string name="math_accessibility_a_times_b" translatable="false">%s times %s</string>
<string name="math_accessibility_a_divides_b" translatable="false">%s divided by %s</string>
<string name="math_accessibility_a_exp_b" translatable="false">%s raised to the power of %s</string>
<string name="math_accessibility_negative_a" translatable="false">negative %s</string>
<string name="math_accessibility_positive_a" translatable="false">positive %s</string>
<string name="math_accessibility_simple_square_root" translatable="false">square root of %s</string>
<string name="math_accessibility_complex_square_root" translatable="false">start square root %s end square root</string>
<string name="math_accessibility_group" translatable="false">open parenthesis %s close parenthesis</string>
<string name="math_accessibility_implicit_multiplication" translatable="false">%s %s</string>
<string name="math_accessibility_simple_fraction" translatable="false">%s over %s</string>
<string name="math_accessibility_complex_fraction" translatable="false">the fraction with numerator %s and denominator %s</string>
</resources>
Loading