ZedAI Numeral Element

From zedwiki

Jump to: navigation, search

Contents

Use Cases

The need to markup numeric/numeral chunks of text has been lurking for a while. Christian brought the theme up concretely on ZedAI_telcon_20100201, in the context of Braille:

Ordinal numbers
need special announcements
ISBN
Replace hyphen with dots
Phone numbers
Replace spaces with dots

As noted on the call, marking something up as numeric/numeral is not a Braille-specific need, has benefits for output formats too. So there is no problem in putting this in the core namespace (alongside its time, name, place etc siblings in the phrasing class.) Note that we are talking about markup in contexts where MathML does not apply (these are simply not mathematical expressions).

Ordinal numbers

In German Braille we use a special number notation for ordinals in that we use the the lower 4 dots of the Braille cell.

  • Example input: "Am 16. Januar." (on the 16th of January)
  • Desired output: "AM #,+ JANUAR."

ISBN

In German Braille dashes in ISBN numbers are replaced by dots.

  • Desired output: ">ISBN #C.DAA.JJIJA.B"

Phone numbers

In German Braille spaces in phone numbers are replaced by dots.

  • Example input: "Tel. 031 / 814 19 20"
  • Desired output: "TEL.#JCA!,#HAD.AI.BJ"

On the term numeral

numeral:: a word or symbol that represents a number (see Number_names)

types of numerals

Base types (again from Number_names)

cardinal
describe quantity - one, two, three, etc. (Can also be expressed with digits, or is it then by definition a natural number?)
ordinal
describe position in a sequential order - first, second, third, etc.; the terms next and last may also be considered a kind of ordinals.
partitive
describe division into fractions - half, third, quarter, etc.
multiplicative
describe repetition - once, twice, thrice, etc.
collective
describe groups or entities composed of several parts - single, double, triple, etc.
distributive
describe dividing and assigning in portions - in pairs, by the dozen.

From wikipedia/Numbers: "In addition to their use in counting and measuring, numerals are often used for labels (telephone numbers), for ordering (serial numbers), and for codes (ISBNs)."

  <p>In the <num role="ordinal">2nd</num> edition ... </p>

  <p>My phone number is <num role="label">321.321.414.7</numeral> ...</p>

TEI P5

The TEI num element seems to be addressing the same topic. Note their type attribute (which is the equivalent of our role attribute).

Note also that the TEI num element covers not only numerals, but also "proper" numbers. (See Number and Number#Numerals to grasp the difference)


Proposal 1: follow TEI

element name 
num
element definition 
represents a number or a numeral
clarification 
need a clear definition of when to use MathML and when to use this, see below
element attributes 
@role (optional, for refinement), @value (optional, for machine-readable value)
in absence of role 
if no @role is specified, num must be interpreted as a cardinal (which in this context would also encompass a natural number)
core vocab properties 
cardinal | ordinal | partitive | multiplicative | collective | distributive | relative and/or percentage

In addition, a specific set of @role values will be defined to express particular forms of numbers and identifiers for contexts where this information is required for rendering (namely braille). This list will include:

  • phone
  • isbn
  • currency
  • postal
  • result (sports scores, votes, etc.)
  • segmented (single number with spaces between the sets)
  • fraction
  • mixed
  • decimal (prevent repetition of number sign after the decimal)
  • roman
  • weight
  • measure

Further complicating the issue is that BANA braille also identifies and distinguishes between codes:

  • morse
  • alphacode (letter codes)
  • numcode (number codes)

Where the latter would work as a num but the two preceding are a stretch. Code is already taken as an element, though.


Proposal 1 Issue 1: num vs MathML

@@Dennis, we need help here

Proposal 1 examples

<p>In the <num role="ordinal">2nd</num> edition ... </p>

<p>My phone number is <num role="label">321.321.414.7</num> ...</p>

<p>Approximately <num value="30000" role="cardinal">thirty thousand</num> lightyears ...</p>

<p>Approximately <num value="30000">30.000</num> lightyears ...</p>

Personal tools