On this page:
4.1 Running the generator
4.2 Internal module codepoint/  generator
generate-modules
4.3 Internal module codepoint/  ucd
fetch-unicode-character-data
8.12

4 Data Generator🔗ℹ

These data files themselves are generated by tooling from the Unicode Character Database primarily UCD.zip and Unihan.zip. These zip files, along with other reference material are downloaded into a temporary location and used to generate the Racket data files used by codepoint/properties. The fetch and generate processes may be used separately but are intended to be run together by the executable ucd-generator.

4.1 Running the generator🔗ℹ

As a part of the build executed by raco setup, an executable named ucd-generator is generated. This tool is used to create a set of data files according to the following steps.

  1. If the temporary directory, data, is not present:
    1. create the temporary directory,

    2. use the curl command to download the required files, and

    3. unzip the UCD.zip file.

  2. If the output directory, generated, is not present then create it.

  3. For each of the relevant source files generate each target data file.

Note that this tool must be run in the root directory of the package.

4.2 Internal module codepoint/generator🔗ℹ

 (require codepoint/generator) package: codepoint

This module has both a provided function interface as well as a main module. The main module is actually the entry point for the generated ucd-generator executable, but can also be invoked directly as racket ./private/generator.rkt.

procedure

(generate-modules root-dir)  boolean?

  root-dir : path-string?
Perform the steps outlined above to download UCD data files and generate the data modules. Generated modules are placed in the generated directory and have a file extension of "rkt-src" as these are not actually modules but the serialized data structures used by the functions in codepoint/properties.

4.3 Internal module codepoint/ucd🔗ℹ

 (require codepoint/ucd) package: codepoint

This module also has both a provided function interface as well as a main module. While this can be invoked on it’s own to download data files it is typically invoked by the generate-modules function, or ucd-generator executable.

procedure

(fetch-unicode-character-data root-dir)  boolean?

  root-dir : path-string?
Perform the steps outlined above to download and unpack the UCD data files.