The BiDiAlgorithm needs tables that classify characters according to the bidi types used in the Unicode Tech Report, UAX#9. These tables use the bidi type classification from unicode.org, and it uses this info for all the 8859 charsets. This is in bidi-table.el – about 500k.
There is also a test table which only sets bidi types for ASCII characters and which uses the bidi type R (like Hebrew and Arabic) for capital letters. This is great when tinkering with the code and when writing test cases in plain ASCII. This is in bidi-table-test.el -- about 5k.
The classification of characters in Emacs relies on CategoryTables. In Emacs, these categories can be modified on the Lisp level. Since I didn’t want to reserve any categories, I’m getting some unused categories when bidi.el is loaded. This seems not to work in XEmacs.