[package]
name = "papagan"
version = "0.1.0"
description = "Fast, small-binary language detection with opt-in language packs"
readme = "README.md"
keywords = ["language", "detection", "nlp", "ngram", "classifier"]
categories = ["text-processing", "algorithms"]
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true

[lints]
workspace = true

[features]
default = ["en", "parallel"]
all-langs = ["de", "en", "tr", "ru", "fr", "es", "it", "nl", "pt", "pl"]
parallel = ["dep:rayon"]

# Dictionary-size tiers. Default (no feature) = 3000 words per language,
# the empirical knee on a 5000-sentence Tatoeba eval (~99.4% accuracy, ~4.9 MB
# for the all-langs example binary). Opt into larger tiers for higher recall
# at the cost of binary size:
#   dict-5k  → 5000 words/lang (~6.5 MB, same accuracy — buys headroom on
#              domain-specific inputs but flat on our eval)
#   dict-10k → 10000 words/lang (~10.5 MB, ~99.7% accuracy — recommended for
#              PyPI/npm wrapper crates where binary size is cheap)
# If both are set, the larger wins. `PAPAGAN_DICT_SIZE` env var overrides.
dict-5k = []
dict-10k = []

de = []
en = []
tr = []
ru = []
fr = []
es = []
it = []
nl = []
pt = []
pl = []

[dependencies]
phf = { version = "0.11", features = ["macros"] }
smallvec = "1.13"
unicode-normalization = "0.1"
unicode-segmentation = "1.12"
rayon = { version = "1.10", optional = true }

[build-dependencies]
phf_codegen = "0.11"
