| 1 | # unicode-categories |
| 2 | `unicode-categories` is a simple crate that adds many extensions |
| 3 | to the `char` type that allow for the querying of whether or not |
| 4 | a character is a member of a certain category of unicode characters. |
| 5 | |
| 6 | ``` |
| 7 | use unicode_categories::UnicodeCategories; |
| 8 | |
| 9 | assert!('a'.is_letter_lowercase()); |
| 10 | assert!('A'.is_letter_uppercase()); |
| 11 | assert!('\n'.is_other_control()); |
| 12 | ``` |
| 13 | |
| 14 | This crate can be obtained from crates.io and used as a dependency |
| 15 | like any other crate. |
| 16 | |
| 17 | ## Regenerating the tables |
| 18 | The script in `scripts/unicode.py` reads a file named `UnicodeData.txt`, |
| 19 | which is assumed to be in the current working directory. This file |
| 20 | can be obtained from ftp://ftp.unicode.org . The script outputs a rust |
| 21 | file to standard out, which can be piped to the desired location. |
| 22 | |
| 23 | ## License |
| 24 | |
| 25 | Licensed under either of |
| 26 | |
| 27 | * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) |
| 28 | * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) |
| 29 | |
| 30 | at your option. |
| 31 | |
| 32 | ### Contribution |
| 33 | |
| 34 | Unless you explicitly state otherwise, any contribution intentionally |
| 35 | submitted for inclusion in the work by you, as defined in the Apache-2.0 |
| 36 | license, shall be dual licensed as above, without any additional terms or |
| 37 | conditions. |