tok_fmt: Canonical text of a model

View source: R/tok.R

tok_fmtR Documentation

Canonical text of a model

Description

Prints the model as ⁠tok fmt⁠ does: one statement per line, canonical order of attributes, comments kept.

Usage

tok_fmt(x, write = FALSE, lang = getOption("tok.lang", "en"))

Arguments

x

A model: a tok_model, the path of a .tok file, or the text of a model.

write

When TRUE and x is a file, the file is rewritten.

lang

Language of the messages, "en" or "pl". The default comes from the option tok.lang.

Value

The canonical text (invisibly when the file is rewritten).

Examples

tok_fmt(system.file("examples", "wypozyczenie.tok", package = "tokr"))

tokr documentation built on Nov. 26, 2026, 5:08 p.m.