按语境查找译文

函数索引 / 语言与字典
forma_translate()
在用户字典及内置字典中查找一个完整标识的译文。公式、标记文本及代码可作为受保护的内容。
怎么用
指定语言和语境,精确的语言标签先于父标签。同一语言和键下,用户提供的译文优先。需要追查匹配来源时可开启诊断。
返回结果
返回与输入对应的字符向量、原受保护对象或诊断表,可区分精确匹配、回退、缺失及受保护等状态。
调用方式
forma_translate(
x,
lang = NULL,
context = "stat",
dictionary = NULL,
missing = c("keep", "warn", "error", "NA"),
diagnostics = FALSE,
type = "text"
)参数
x、lang、context、dictionary、missing、diagnostics、type
R 示例
forma_translate(c("observed", "expected"), "ja")
forma_translate(c("count", "absent"), "ar-EG", diagnostics = TRUE)
forma_translate(expression(sqrt(x)), "ar")