Some parts of this website may do not work correctly, because your browser doesn't support JavaScript or you have disabled it. In order to use all features please enable JavaScript in your browser.

Specification for writer > simple-writer

simple-writer

Simple Writer prints the content of the lattice in a simple, human-readable way. By default, it writes token segments separated by newline symbols, skipping blank segments.

In other words, simple-writer prints contents of lattice edges labeled by the layer tag token. This “default” layer tag can be changed using the --tags option. The string that separates printed edges can be specified by the --sep option. Additional separators for “higher order” edges can be specified with --spec option, which should be used in the following manner: --spec layer_tag_1 separator_1 layer_tag_2 separator_2 ... layer_tag_n separator_n.

The default behavior of skipping edges containing only whitespaces can be reverted by the option --with-blank.

By default, simple-writer prints all edges tagged with the basic tag. When two or more such edges have common start points, they are separated by the alternative edges separator, which defaults to | and can be changed by the --alt-sep option. The simple-wirter can be forced to print only the first alternative edge by switching on the --no-alts option. Edges that start before the end of the previous one (“cross-edges”) can be prevented from being printed by switching on the --linear option.

Aliases

write, write-simple

Examples

segment ! tokenize --lang en ! simple-writer --tags symbol --sep / --spec token || segment \\n

Write text's symbols, tokens and segments separated by slashes, double vertical bars and newlines respectively.

in:
I am. You are. We are.
out:
I||a/m||.
||Y/o/u||a/r/e||.
||W/e||a/r/e||.
spell-check --lang en ! simple-writer --alt-sep /

Print spelling correction suggestions separated by /.

in:
Paast Perphect Continous
out:
Paast/Past/Pasta/Paste/Pasty/Psst/Pluperfect/Postponed/Stupefied/Postmarked/Postcode
Perphect/Perfect/Perfecta/Prefect/Perfects/Perfecter
Continous/Continuous/Continues/Contains/Continua/Contiguous
tokenize --lang en ! simple-writer

Tokenize English text.

in:
It's his 15th birthday.
out:
It's
his
15th
birthday
.

Options

Allowed options:
  --alt-sep arg (=|)    alternative edges separator
  --fallback-tags arg   tags that should be printed out if basic tags not found
  --linear              skip cross-edges
  --no-alts             skip alternative edges
  --with-blank          do not skip edges with whitespace text
  --sep arg (=
)        basic tag separator
  --spec arg            specification of higher-order tags and their separators
  --tags arg (=token)   basic tag or tags separated by commas (conjunction) or 
                        semicolons (alternative)

Other help resources