Project

Profile

Help

Bug #4040

closed

Hyphenation of spelled-out English numbers

Added by Michael Kay over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Localization
Sprint/Milestone:
-
Start date:
2018-11-20
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.9
Fix Committed on Branch:
9.9
Fixed in Maintenance Release:
Platforms:

Description

Style guides for English generally recommend hyphenating numbers in the range 21-99, for example "twenty-two", "fifty-three". Saxon traditionally uses a space rather than a hyphen in these numbers. (This affects, for example, xsl:number and format-integer).

Both conventions are encountered in practice, especially in titles such as "Chapter Twenty Two". Even if the hyphenated style is more common, it wouldn't be a good idea for Saxon to change its output for compatibility reasons.

When we incorporated ICU for numbering, we retained the existing convention for compatibility, post-processing the ICU output to remove the hyphens.

The standards allow a language code to contain "extensions" of the form "x-variant", and I propose we use "x-hyphen" (for example "en-x-hyphen" or "en-GB-x-hyphen" to request hyphenation of numbers. This should work in both xsl:number and format-integer.

Actions #1

Updated by Michael Kay over 5 years ago

  • Description updated (diff)
Actions #2

Updated by Michael Kay over 5 years ago

  • Status changed from New to Resolved
  • Applies to branch 9.9 added
  • Fix Committed on Branch 9.9 added

The goal of backwards compatibility turns out to be made more tricky by the fact that ordinal numbering is currently incompatible depending on whether ICU is used. With Saxon-HE, we currently get "twenty-third", with EE, we get "twenty third".

So I'll introduce "en-x-nohyphen" to force the use of space as separator, and if neither is specified, it continues to behave inconsistently.

I have committed the change on the 9.9 branch, and have updated the documentation on the trunk.

Actions #3

Updated by Michael Kay over 5 years ago

  • Description updated (diff)
Actions #4

Updated by Debbie Lockett over 5 years ago

Documentation change copied from trunk to 9.9 branch (and from src/extensibility/locales-ICU-numbering.xml, to its generating stylesheet style/document-ICU.xsl).

[Online documentation to be updated with next maintenance release.]

Actions #5

Updated by O'Neil Delpratt over 5 years ago

  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.9.1.1 added

Bug fix applied to the Saxon 9.9.1.1 maintenance release.

Actions #6

Updated by O'Neil Delpratt over 5 years ago

  • Status changed from Resolved to Closed

Please register to edit this issue

Also available in: Atom PDF