Skip to content

fix(tn/en): read "in" as inches only when attached to the number - #115

Merged
Alex-Wengg merged 1 commit into
FluidInference:mainfrom
unaltolga:fix-tn-en-in-after-space
Nov 13, 2026
Merged

Alex-Wengg merged 1 commit into
FluidInference:mainfrom
unaltolga:fix-tn-en-in-after-space

Conversation

@unaltolga

@unaltolga unaltolga commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

In sentence mode, a number followed by a spaced "in" matched the inch unit, so the preposition became a unit:

input main (2e08564)
I have 5 in the box. I have five inches the box.

NeMo has no "in" unit (data/measure/unit.tsv); it reads the inch mark instead (12" -> twelve inches).

With this change, "in" reads "inch" only when it is written against the number (27in -> twenty seven inches), the way single-letter units already need a space before they match. 5 in on its own is left to the other taggers.

Tests

  • Two cases in test_sentence_prose_false_positives (tests/en_tn_tests.rs): I have 5 in the box. fails on main and passes with the change; a 27in monitor still reads inches.
  • test_in_only_attached in src/tn/en/measure.rs checks parse.

Checks

  • cargo test passes.
  • The NeMo parity check reports no regressions; the counts are unchanged.
  • cargo fmt --all --check passes, and clippy reports the same warnings as main.

AI disclosure: written with Claude Code (Claude Opus 5.5), which found the issue, wrote the change, the tests and this description. I reviewed it and ran the checks on my Mac.


Devin Review

In sentence mode, "in" after a spaced number matched the inch unit, so
the preposition became a unit: "I have 5 in the box." read "I have five
inches the box." NeMo has no "in" unit; it reads the inch mark (12")
instead. "in" now reads "inch" only when written against the number
("27in"), the way single-letter units already need a space to match.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@Alex-Wengg
Alex-Wengg merged commit 36dc684 into FluidInference:main Nov 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants