I want to bundle a word list in plain text format with my Cargo package. Can I edit Cargo.toml in order to do this?
If I used npm, I would add this to my package.json:
"files": ["data/my_dictionary.txt"]
I tried include
but it doesn't seem to work.
Here is my Cargo.toml
[package]
name = "chamkho"
version = "0.0.2"
authors = ["Vee Satayamas <[email protected]>"]
test = true
description = "Thai word segmentation/breaking library and command line"
documentation = "https://github.com/veer66/chamkho/blob/master/README.md"
homepage = "https://github.com/veer66/chamkho/"
repository = "https://github.com/veer66/chamkho.git"
readme = "README.md"
keywords = ["text", "nlp", "thai", "library"]
license = "BSD-2-Clause"
include = ["**/*.txt", "**/*.rs","Cargo.toml"]
[[bin]]
name = "wordcut"
path = "src/cli.rs"
This is the output of cargo package -l
Cargo.toml
src/acc.rs
src/cli.rs
src/dict.rs
src/edge.rs
src/graph.rs
src/graph_builder.rs
src/lib.rs
src/space_acc.rs
src/wordcut.rs
tests/wordcut.rs
I believe include = ["data/my_dictionary.txt"]
should work.
(I opened a PR adding this to the documentation.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With