Repository navigation
Enable test running for Finnish ASCIIMath and write more tests - #1054
Conversation
Rust doesn't allow files to start with a number, so the file name was changed.
I included the r# and # as in the other tests (not really sure what they do).
The rule folder wasn't being accessed since Rust seems to drop the hyphen in a folder name. Now the rules are being pulled from the correct folder.
This is a copy of the ASCIIMath cleanup at the moment.
This is Finnish notation.
The cleanup function is a duplicate. If they need to change later, then make a duplicate and change it or just add a test case
|
I think we may want to make the braille system work like the language system where you can regional variants. That would like remove a lot of duplication for things like this. That's maybe for next year, but I'll add an issue for it. |
|
@samimaattaCelia: most of the tests fail. I have merged in main so that this branch is up-to-date, but I did not try to fix the tests. It looks like most of the failures are related to white space issues. |
|
Do the tests fail because the rules haven't been made for ASCIIMath_fi or is there a problem with hardcoding whitespaces to the unicode files? |
|
Do the tests fail because the rules haven't been made for ASCIIMath_fi
or is there a problem with hardcoding whitespaces to the unicode files?
I don't understand the question. There are rules for ASCIIMath_fi. I just
did a diff and I see a few differences
between ASCIIMath/ASCIIMath_Rules.yaml and
ASCIIMath_fi/ASCIIMath_fi_Rules.yaml.
Looking at a few failures:
```
---- braille::ASCIIMath_fi::other::mixed_fraction stdout ----
Error: MathCAT crash! Please report the following information: 'assertion
`left == right` failed
left: "2#1/2"
right: "2 1/2"' at tests\common\mod.rs:175:0
```
It appears you want something special (add `#`) for a mixed fraction. But
there is no rule for that so the rules for '2' and for '1/2' apply. You can
look in some other files for how mixed fractions are handled and then
modify them here.
A lot of the sixDotSpecs examples fail due to spacing. For example:
```
---- braille::ASCIIMath_fi::sixDotSpecs::greater_than_with_more_variables
stdout ----
Error: MathCAT crash! Please report the following information: 'assertion
`left == right` failed
left: "2 xy > 6"
right: "2xy > 6"' at tests\common\mod.rs:175:0
```
Spaces are normally inserted between rule firings. If you don't want them,
use "CT" (or "TC") for (in this case) the rule for `>` in unicode.yaml.
That concatenates the output on the previous/next entry. You'd do that for
numbers and letters also in this example.
Does that help?
Message ID: ***@***.***>
… |
|
My understanding was that you hadn't done ASCIIMath_fi specific rules before, but I stand corrected since there are differences! Is it now expected for translators to make the rules? I think I can check for some of the easier-to-understand rules (such as the mixed fraction one and spacing), but if a totally new rule has to be written, I would need your help. |
Tests were not running, now fixed
There was a problem that when the ASCIIMath-fi tests were run, they were tested against the default ASCIIMath rules. It was most likely caused by Rust dropping the hyphen ("-fi") and targeting ASCIIMath folder for rules. This is now fixed. The folders and tests have been named
ASCIIMath_fi.Cleanup created for ASCIIMath_fi
I also noticed that the same cleanup for ASCIIMath
ASCIIMath_cleanup(pref_manager, braille_string)was being run for ASCIIMath_fi. I added a function so that cleanup can be run separately for ASCIIMath_fi.It is just a copy and paste of the ASCIIMath, and I'm not sure if it is totally needed. I wasn't sure in which order the cleanup is performed. Is it cleaning up MathML or the generated ASCIIMath?
Now it exists if it needs to be configured separately.
Tests
I have written more tests for ASCIIMath_fi and also added the 6-dot tests I had written for
fi-braille. The coverage is better now thanks to this.Unicode files
I added couple of characters to the unicode files.
Next steps
If I have read the code correctly, there are no Finnish ASCIIMath rules. They are just the same rules that apply to ASCIIMath. I think the next thing would be to get some new rules.
Relates to #500