A small Rust library to convert between the Esperanto x-system and Unicode circumflexes.
Provides a couple of utilites to convert between the Esperanto x-system (like “ehxosxangxocxiujxauxde”) and Unicode characters with circumflexes (like “eĥoŝanĝoĉiuĵaŭde”). When converting from the x-system, the X can be either a capital X or a lower-case x regardless of the case of the previous character. When converting to the X system the X will match the case of the Esperanto letter.
To use the Crate, run the following command in your project’s repository:
cargo add xsystem
The simplest way to use the Crate is with the functions
x_to_unicode and unicode_to_x. These convert a string slice
with one coding system to a String with the other. For example:
use ;
let unichars = x_to_unicode;
assert_eq!;
let xchars = unicode_to_x;
assert_eq!;
You can also use the functions x_chars and unicode_chars which
adapt a char iterator to perform the conversion on the fly. For example:
use ;
let shouty_x = x_chars
.map
.flatten
.;
assert_eq!;
let first_converted_char = unicode_chars
.position;
assert_eq!;