NLP Kernewek
The module niverow.py
writes numbers in Cornish. Options exist to include a noun or not, and to use a plural noun in cases of very large numbers. The function numberkw(num)
allows an integer to be input to be written out in words, the function numberkw_noun(num, noun, fem, npl)
allows input of a number along with a noun, a flag to indicate gender, and the plural of the noun. numberkw_float
outputs numbers containing a decimal point, or negative numbers into text, and numberkw_float_noun
does such numbers including the noun, which is written in the number + 'a' + plural noun format. The numbers after the decimap point are output individually one at a time.
I have recently (October 2020) ported this module's functionality to Javascript along with a Cornish language clock. I have also created a maths quiz in Cornish.
>>> import niverow
>>> niverow.numberkw(42)
'dew ha dew ugens'
>>> niverow.numberkw_noun(42,"ki", False, "keun")
'dew gi ha dew ugens'
>>> niverow.numberkw_noun(42,"kath", True, "kathes")
'diw gath ha dew ugens'
>>> niverow.numberkw_noun(9999,"kath", True, "kathes")
'naw mil, naw kans, nownsek ha peswar ugens a gathes'
>>> niverow.numberkw_float(-34.7)
'minus peswardhek warn ugens poynt seyth'
>>> niverow.numberkw_float_noun(9.57,"kilogramm", False, "kilogrammow")
'naw poynt pymp, seyth a gilogrammow'
False
(masculine) if not included.