# Arqam golden book

## Purpose

To provide the most rigorous, complete, and strictly grammar-aligned golden reference dataset for Arabic cardinal numbers (الأعداد الأصلية).

The dataset serves as an authoritative verification standard for Arabic number-to-words (tafqeet / تفقيط) libraries and engines. Any library or implementation can generate its output for the included numbers and directly compare it against the Gold Book entries to measure accuracy against high-standard Arabic grammar rules for numbers.

## The files

Reference words for Arabic tafqeet (numbers in words), for testing any engine in any programming language.
Six files: three tashkeel levels, each with the legal form (Auto) and without it (Normal). Each set in a file is one
gender and case; each entry is `"number": "words"`.

| File | Tashkeel | Legal form | Status |
|---|---|---|---|
| `goldenCardinal_TashkeelNone.json` | no marks at all (أحد عشر ألفا) | auto: مائة ألف وألفان (102000) | verified |
| `goldenCardinal_TashkeelAlif.json` | the tanween of the accusative on the alif only (أحد عشر ألفاً) | auto | verified |
| `goldenCardinal_TashkeelFull.json` | full tashkeel (أَحَدَ عَشَرَ أَلْفاً) | auto | verified |
| `goldenCardinal_TashkeelNone_Normal.json` | no marks at all | none: مائة وألفان (102000) | verified |
| `goldenCardinal_TashkeelAlif_Normal.json` | the tanween alif only | none | verified |
| `goldenCardinal_TashkeelFull_Normal.json` | full tashkeel | none | verified |

An engine that does not write the legal form is tested with the `_Normal` files, on its grammar alone.

Each file holds six sets, `cardinal_<Male|Female>_<Raf|Nasb|Jarr>_<None|Alif|Full>_<Auto|Normal>`, with the same
7,934 numbers: every number from 0 to 999; 1, 2, 3, 8, 10, 11, 12, 13 and 18 in every place a count can stand (alone,
after a hundred, before and after every scale word); scales up to quadrillion (10^15); the largest is
999,999,999,999,999,999.

The rules a set follows are in the file itself: the header's `conventions` (spelling, joining, order, scale names,
the legal form, the tanween, the order of the marks) and each set's `rules` (its case and gender).

To test an engine: for each set, write each number in words in that case and gender, following the conventions,
and compare with the entry, character for character.

## Any language that can read JSON

The golden book is plain JSON. There is no dependency on a specific language or runtime. A library (or a one-off
script) in any of the following can load the files and compare its output against the entries:

### Most common
- **JavaScript / TypeScript** (Node, Deno, Bun, browser)
- **Python**
- **Java**
- **C# / .NET**
- **Go**
- **Rust**
- **PHP**
- **Ruby**
- **Swift**
- **Kotlin**

### Also straightforward
- **C / C++** (with a JSON library such as nlohmann/json or cJSON)
- **Dart / Flutter**
- **Scala**
- **Elixir / Erlang**
- **Haskell**
- **R**
- **Julia**
- **Perl**
- **Lua**

### Practical note
The only requirement is the ability to:
1. Parse a JSON object
2. Iterate over the sets and number keys
3. Compare strings

Even languages without a built-in JSON parser can use one. The golden book itself imposes no language restriction.

Made from the Arqam engine; every entry is checked against the stated conventions, and every entry reads back
to its own number. © 2021–2026 Mohsen Alyafei · MIT
