[package]
name = "odict"
description = "A blazingly-fast dictionary file format for human languages"
homepage = "https://odict.org"
repository = "https://github.com/TheOpenDictionary/odict"
version = "3.2.2"
edition = "2021"
license = "MIT"
exclude = ["benches/*", "tests/*"]

[features]
sql = ["dep:sea-query"]
config = ["dep:dirs"]
js = ["uuid/js"]
alias = ["config"]
http = [
  "dep:reqwest",
  "dep:reqwest-middleware",
  "dep:reqwest-retry",
  "dep:regex",
  "dep:futures-util",
  "config",
]
html = ["markdown"]
search = ["dep:tantivy", "config"]
markdown = ["dep:pulldown-cmark"]
default = ["sql", "config"]

# Language-specific support
charabia = ["dep:charabia"]
tokenize = [
  "tokenize-latin",
  "tokenize-chinese",
  "tokenize-japanese",
  "tokenize-thai",
  "tokenize-korean",
  "tokenize-khmer",
  "tokenize-swedish",
  "tokenize-german",
]
tokenize-latin = ["dep:charabia"]
tokenize-chinese = ["tokenize-latin", "charabia/chinese-segmentation"]
tokenize-japanese = ["tokenize-latin", "charabia/japanese"]
tokenize-thai = ["tokenize-latin", "charabia/thai"]
tokenize-korean = ["tokenize-latin", "charabia/korean"]
tokenize-khmer = ["tokenize-latin", "charabia/khmer"]
tokenize-swedish = ["tokenize-latin", "charabia/swedish-recomposition"]
tokenize-german = ["tokenize-latin", "charabia/german-segmentation"]

[[bench]]
name = "lib"
harness = false

[dependencies]
byteorder = "1.5.0"
quick-xml = { version = "0.38.4", features = ["serialize"] }
rayon = "1.11.0"
indexmap = { version = "2.12.1", features = ["serde", "rayon"] }
charabia = { version = "0.9.9", optional = true, default-features = false }
rkyv = { version = "0.8.12", features = ["indexmap-2", "uuid-1"] }
serde = { version = "1.0.228", features = ["serde_derive"] }
uuid = { version = "1.18.1", features = [
  "v4",
  "fast-rng",
  "macro-diagnostics",
] }
url = "2.5.7"
serde_json = "1.0.145"
thiserror = "2.0.17"
brotli = "8.0.2"
structural-convert = { workspace = true }

# feature=markdown
pulldown-cmark = { version = "0.13.0", optional = true }
# feature=http
reqwest = { version = "0.12.24", optional = true, default-features = false, features = [
  "rustls-tls",
  "http2",
  "stream",
] }
strum = { version = "0.27.2", features = ["derive"] }
reqwest-middleware = { version = "0.4.2", optional = true }
reqwest-retry = { version = "0.8.0", optional = true }
futures-util = { version = "0.3", optional = true }
regex = { version = "1.12.2", optional = true }
# feature=search
tantivy = { version = "0.25.0", optional = true }
# feature=config
dirs = { version = "6.0.0", optional = true }
# feature=sql
sea-query = { version = "0.32.7", optional = true }


[dev-dependencies]
criterion = { version = "0.8.0", features = ["async_tokio", "html_reports"] }
insta = "1.44.3"
map-macro = { version = "0.3.0" }
tokio = { version = "1.48.0", features = ["rt", "macros"] }
wiremock = "0.6.5"
tempfile = "3.23.0"
regex = "1.12.2"

[lib]
name = "odict"
crate-type = ["cdylib", "staticlib", "lib"]
