[package] authors = ["Hung-I Wang "] categories = ["text-processing", "localization", "value-formatting", "wasm"] description = "Traditional/Simplified and regional Chinese variants converter based on MediaWiki & OpenCC rulesets and powered by AC automata 轉換简体、繁體及兩岸、新馬中文地區詞,基於MediaWiki和OpenCC之字詞轉換表" edition = "2021" license = "GPL-2.0-or-later" name = "zhconv" repository = "https://github.com/Gowee/zhconv-rs" version = "0.3.1" [lib] crate-type = ["cdylib", "rlib"] [features] # OpenCC rulesets are disabled by default. # Enabling the feature may improve accuracy at the cost of binary size bloating and performance # degration. default = ["compress"] opencc = ["lazy_static"] compress = ["zstd", "ruzstd"] [dependencies] daachorse = "1.0" itertools = "0.10" lazy_static = "1.4" # TODO: switch to once_cell once_cell = "1.8" regex = "1.5" ruzstd = { version = "0.4", optional = true } strum = { version = "0.24", features = ["derive"] } [target.'cfg(target_arch = "wasm32")'.dependencies] wasm-bindgen = "0.2" # The `console_error_panic_hook` crate provides better debugging of panics by # logging them with `console.error`. This is great for development, but requires # all the `std::fmt` and `std::panicking` infrastructure, so isn't great for # code size when deploying. console_error_panic_hook = {version = "0.1"}#, default-features = true, optional = true} # # `wee_alloc` is a tiny allocator for wasm that is only ~1K in code size # # compared to the default allocator's ~10K. It is slower than the default # # allocator, however. # # # # Unfortunately, `wee_alloc` requires nightly Rust when targeting wasm for now. # wee_alloc = {version = "0.4", default-features = true, optional = true} [dev-dependencies] criterion = "0.3" wasm-bindgen-test = "0.3" [build-dependencies] daachorse = "1.0" hex-literal = "0.4" itertools = "0.10" lazy_static = { version = "1.4", optional = true } once_cell = "1.8" regex = "1.5" sha2 = "0.10" vergen = { version = "8.2", features = ["build", "git", "gitcl"] } zstd = { version = "0.12", optional = true } [[bench]] harness = false name = "zhconv_benchmark" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html