-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
typeanswer: [type:nc] – ignores combining characters #3422
Open
twwn
wants to merge
19
commits into
ankitects:main
Choose a base branch
from
twwn:typeanswer-ignore-combining
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
twwn
force-pushed
the
typeanswer-ignore-combining
branch
2 times, most recently
from
September 16, 2024 16:00
0cd34f0
to
1922d25
Compare
Thanks twwn, I'll try to review this soon. (For my own reference, previous PR: #680) |
no functional change
no functional change
No use to run all that code without input.
No use in this case.
Either a new check or the call was too complex previously for it to trigger?
twwn
force-pushed
the
typeanswer-ignore-combining
branch
from
September 22, 2024 12:04
1922d25
to
331f027
Compare
* elide middle of deck names * Update CONTRIBUTORS * made elide mode enum * add elide mode field * fix enum number * remove dataclass decorator * Update CONTRIBUTORS * format rust code * Update CONTRIBUTORS * formatting * Update CONTRIBUTORS * fix type hint * Update CONTRIBUTORS
…ankitects#3394) (ankitects#3398) * Add comment about the usage of the input field in the statistics page (ankitects#3394) * Fix formatting issues (ankitects#3394) * Update ts/routes/graphs/RangeBox.svelte Co-authored-by: Mike Hardy <github@mikehardy.net> * Update ts/routes/graphs/RangeBox.svelte Co-authored-by: Mike Hardy <github@mikehardy.net> --------- Co-authored-by: Damien Elmes <dae@users.noreply.github.com> Co-authored-by: Mike Hardy <github@mikehardy.net>
* Fix occlusion rounding bug * Fix contributors
* Fix clipboard pasting from the primary selection * Small renaming * Fix submodules * Fix pylint false positive
* Update deck-config.ftl * Update deck-config.ftl * remove the warning
* Delay optimal FSRS params alert to ensure progress updates are reported * Ensure progress updates arrive synchronously
* Add "Show in folder" option to images in editor Credits: @abdnh's Reveal in File Manager add-on (https://github.com/abdnh/anki-misc/tree/master/reveal_in_file_manager) * Refactor
Adds a comparison variant to [type] which ignores when combining characters of the expected field are missing from the typed input. It still shows these characters in the 'expected' line for reference. It's useful for languages with e.g. diacritics that are required for reference (such as in dictionaries), but rarely actually learned or used in everyday writing. Among these languages: Arabic, Hebrew, Persian, Urdu. The bool 'combining' controls it as new final parameter of both relevant compare_answer functions. On the Python side, it's set to true by default. Use on the note templates: [type:nc:field] (only the front needs to include :nc) This also removes the need to have both variants of words/sentences present as separate fields, to show them redundantly, etc.
Requires adjusting two testcases, but both render exactly the same in Anki itself. On NFC vs. NKFD: https://stackoverflow.com/a/77432079
Should get rid of most relocations, but at the expense of over-allocating. On Vec's (String's) behavior: https://stackoverflow.com/a/72787776
twwn
force-pushed
the
typeanswer-ignore-combining
branch
from
September 22, 2024 14:03
331f027
to
817e719
Compare
The minor commits are suggestions, each with a link to relevant Stack Overflow threads in their messages.
I'll close this PR & reopen a new one after review, the incremental rebases are rather tedious. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Building on my previous PR's cleanup, adds a comparison variant to
[type]
which ignores when combining characters of the expected field are missing from the typed input. It still shows these characters in the "expected" line for reference.It's useful for languages with e.g. diacritics that are required for reference (such as in dictionaries), but rarely actually learned or used in everyday writing. Among these languages: Arabic, Hebrew, Persian, Urdu.
Previously:
Now:
[This also removes the need to have both variants of words/sentences present as separate fields, to show them redundantly, etc.]
The bool
combining
controls it as new final parameter of both relevantcompare_answer
functions. In Python, it's set to true by default.Use on the note templates:
[type:nc:field]