A Rule-Based Approach to Number Spellout
Richard Gillam - Language Analysis
Systems, Inc.
Intended Audience: |
Software Engineers, Systems Analysts |
Session Level: |
Intermediate |
One task that comes up from time to time, especially in
financial applications, is the task of rendering a numeric value in
words -- for example, 123 is shown as "one hundred twenty-three".
Writing a routine to do this in English is trivially easy, but
generalizing it to work with ANY language is surprisingly
complicated. This task describes the novel solution to the problem used in
ICU: A "programmable" number formatter based on a simple yet
expressive description language that lends itself well not only to
spelling out numeric values in words, but to a wide variety of
other number formatting applications. |