我想用纯文本格式将单词列表与我的Cargo包捆绑在一起.我可以编辑Cargo.toml来执行此操作吗?
如果我使用npm,我会将其添加到我的package.json:
"files": ["data/my_dictionary.txt"]
Run Code Online (Sandbox Code Playgroud)
我试过include但它似乎没有用.
这是我的Cargo.toml
[package]
name = "chamkho"
version = "0.0.2"
authors = ["Vee Satayamas <vsatayamas@gmail.com>"]
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"
Run Code Online (Sandbox Code Playgroud)
这是输出 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
Run Code Online (Sandbox Code Playgroud) 我想使用EDN解析器,但它位于https://github.com/mozilla/mentat中.https://github.com/mozilla/mentat/tree/master/edn有自己的Cargo.toml.
我试过这个:
[dependencies]
edn = { git = "https://github.com/mozilla/mentat/tree/master/edn" }
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
是否可以在mentat存储库中向此包添加依赖项?
我想知道 OCaml 是否可以执行类似于以下代码(在 TypeScript 中)的操作:
interface User {
name: string
email: string
}
function titi(user: User) {
console.log(user)
}
let u1 = {name: "v2"}
let u2 = {...u1, email: "v2@x.y.z"}
titi(u2)
Run Code Online (Sandbox Code Playgroud)