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

[pt] Improve behaviour of compound measurements #10600

Merged
merged 5 commits into from
May 16, 2024

Conversation

p-goulart
Copy link
Collaborator

@p-goulart p-goulart commented May 16, 2024

For measurements that include multiplication signs, our disambiguator is not adding an ignore_spelling flag, which results in stuff like this:

Screenshot 2024-05-16 at 11 41 01 AM

From the speller dashboard:

Screenshot 2024-05-16 at 11 49 57 AM

Note that here they look like proper multiplication signs, but if you look at the regex and inspect the values, you'll see they are really just x. Probably the browser being clever when rendering stuff.


This PR:

  • adds X_AS_MULTIPLICATION_SIGN_IGNORE to the disambiguator (this the most important thing);
  • adds tests to the speller and tokeniser (just to be on the safe side);
  • add an example to MULTIPLICATION_SIGN picky rule (to make sure the x can properly be changed to a × even before unspaced units);
  • improves the messages for UNITS_OF_MEASURE_SPACING picky rule (chapter 7,103 of 'our messages all sound like pt-PT).

Note that, because of our current tokenisation logic, unit spacing will not be fixed for tokens like 500x500mm. For it to work, one would first need to apply the MULTIPLICATION_SIGN suggestion. (IMO that's probably fine, since these are picky rules. The most crucial thing here was no longer flagging stuff like 5x5 and 5x5mm as spelling errors.)

@p-goulart
Copy link
Collaborator Author

There was a bit of a peak this week, but note how this is nothing new.

Screenshot 2024-05-16 at 11 57 50 AM

@p-goulart
Copy link
Collaborator Author

4de7888 adds DICE_ROLL_NOTATION to ignore stuff like 1d6 (roll one 6-sided die), 3d20 (roll three 20-sided dice), etc.

@p-goulart p-goulart merged commit afe2828 into master May 16, 2024
2 checks passed
@p-goulart p-goulart deleted the pt/grammar/compound_measures branch May 16, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants