Skip to content

canonicalize: keep ":" in a time with intent=':time' (not a ratio) - #1171

Open
pablgonz wants to merge 1 commit into
daisy:mainfrom
pablgonz:time-ratio
Open

pablgonz wants to merge 1 commit into
daisy:mainfrom
pablgonz:time-ratio

Conversation

@pablgonz

@pablgonz pablgonz commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

is_ratio changes 9:30 to the ratio 9 ∶ 30, even when the author marks it as a time:

<math><mrow intent=":time"><mn>9</mn><mo>:</mo><mn>30</mn></mrow></math>

The ratio inference then wins and the :time property is lost, so a language rule for times never sees it (Spanish, with #1159: "9 es a 30" instead of "las 9 y media").

Now is_ratio returns false when the parent mrow has :time in its intent. Without the intent, 9:30 is still a ratio.

  • New tests colon_in_time_not_ratio and colon_ratio in src/canonicalize.rs.
  • cargo test and cargo clippy --tests pass.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor
Linux library size: 0.61 MiB (0.00%)
Revision Release liblibmathcat.so
Base (fcc2f04) 0.61 MiB (635,928 bytes)
PR (32800d3) 0.61 MiB (635,928 bytes)
Change 0 bytes (0.00%)

Built with default features, Rust 1.96.0, and Ubuntu 24.04. Workflow run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant