Constructing Lingala prose numerals

As we've seen in some of the lab exercises, computers are really good at counting. But can we teach them to transfer this talent from the purely numerical realm to one that involves a human language?

Here are the words for the integers from 1 to 9 in Lingala, a Bantu language spoken by about six million people, most of them living near the Congo River:

1  moko
2  mibale
3  misato
4  minei
5  mitano
6  motoba
7  nsambo
8  mwambe
9  libwa

The word for 10 is zomi, but the prose numerals for multiples of 10 from 20 to 90 are formed from an alternative word for 10, ntuku, and the word for the multiplier:

10  zomi
20  ntuku mibale
30  ntuku misato
40  ntuku minei
    ...
90  ntuku libwa

The prose numerals for multiples of 100 up to 900 are formed from the word nkama (`hundred') and the word for the multiplier:

100  nkama moko
200  nkama mibale
300  nkama misato
     ...
900  nkama libwa

Similarly, the prose numerals for multiples of 1000 up to 9000 are formed from the word nkoto (`thousand') and the word for the multiplier:

1000  nkoto moko
2000  nkoto mibale
3000  nkoto misato
     ...
9000  nkoto libwa

From these forms, one can construct the prose numeral for any integer from 1 to 9999 by linking together the forms for the non-zero digits with the particle na (`and'):

  11  zomi na moko
  12  zomi na mibale
  21  ntuku mibale na moko
  84  ntuku mwambe na minei
 157  nkama moko na ntuku mitano na nsambo
 365  nkama misato na ntuku motoba na mitano
 440  nkama minei na ntuku minei
 706  nkama nsambo na motoba
 913  nkama libwa na zomi na misato
1111  nkoto moko na nkama moko na zomi na moko
2001  nkoto mibale na moko
5082  nkoto mitano na ntuku mwambe na mibale
7645  nkoto nsambo na nkama motoba na ntuku minei na mitano
8308  nkoto mwambe na nkama misato na mwambe
9999  nkoto libwa na nkama libwa na ntuku libwa na libwa

Develop a Scheme procedure Lingala-numeral that takes any integer in the range from 1 to 9999 as argument and returns a string that gives the Lingala word for that integer. (Include a precondition test that enforces the range restriction.)

Using this procedure, develop a Scheme procedure count-in-Lingala that takes any two integers, start and finish, in the range from 1 to 9999, and constructs and returns a list of the Lingala prose numerals for the integers from start to finish, inclusive. The procedure should, in effect, count upwards if start is less than finish and downwards if start is greater than finish.

My source of information about Lingala prose numerals is Lingala basic course, by James Redden, F. Bongo, and associates (Washington, D.C.: Foreign Service Institute, 1963), pp. 47-50 and 165.


This document is available on the World Wide Web as

http://www.cs.grinnell.edu/~stone/courses/scheme/exercises/Lingala-numerals.xhtml

Validated as XHTML 1.1 by the World Wide Web Consortium Cascading Style Sheet validated by the World Wide Web Consortium

created October 11, 2001
last revised January 3, 2002

John David Stone (stone@cs.grinnell.edu)