If you want to contribute to the source code, feel free to do so! ❤️
Don't forget to state what should be changed and their respective reasons.
If you want to see/modify on the codepoints supported and/or their respective translation(s), feel free to do so! Here are the ways on how to do them;
- To convert the binary into a readable text file, do the following:
node scripts/read.mjs path/to/output.txt- To convert the binary into a readable and modifiable JSON, do the following:
node scripts/read.mjs [path/to/output.json]If the output file name is not supplied, it will default to output.json.
- And to validate, optimize, and convert the JSON back into a binary, do the following:
node scripts/write.mjs path/to/input.json- The structure of the JSON is as follows:
The optional fields here are only optional when writing and encoding them back into a binary.
interface Codepoint {
codepoint: number
translation: string
}
interface JsonContents {
codepoints: Codepoint[]
similar: string[][]
}-
Information regarding the
Codepointstructure:- The
JsonContents#codepointsarray must NOT be empty. Codepoint#codepointis the unicode codepoint. It must be around\u80to\ue00ffand must NOT be a surrogate.Codepoint#translationis the translation string: its length must not exceed15, it must be in lowercase, and it must be in ASCII.
- The
-
Information regarding the
JsonContents#similarfield:- The
string[][]two-dimensional array must NOT be empty and its length must NOT exceed127. - The
string[]arrays must NOT be empty and their lengths must NOT exceed255. - Each
stringmust ONLY be one character long. - Each
stringmust be ASCII.
- The
Other useful scripts have been added as a utility for maintaining decancer.
Run this every time you modify the root README file.
node scripts/readme.mjsPrerequisites:
node scripts/pretty.mjsnode scripts/version.mjs 1.2.3node scripts/update_unicode.mjs