slmseg(1)

slmseg1

Maximum matching segment chinese text.

Usage

slmseg -d dict_file [option] ... [corpus_file] ...

Overview

slmseg is a tool for segmenting Chinese text into words using maximum matching algorithm. slmseg segments corpus_file, or standard input if no filename is specified, and write the segmented result to standard output.

Options

-d dict_file

Use dict_file as lexicon. A default lexicon can be found at /usr/share/sunpinyin-slm/dict.utf8.

-f,--format (text|bin)

Output Format, can be 'text' or 'bin'. default 'bin'. Normally, in text mode, word text are output, while in binary mode, binary short integer of the word-ids are written to stdout.

-s, --stok STOK_ID

Sentence token id. Default 10. It will be written to output in binary mode after every sentence.

-i, --show-id

Show Id info. Under text output format mode, attach id after known words. If under binary mode, print id(s) in text.

-m, --model language-model-file Specify the language model file. This file is always generated by slmthread.

Notes

Under binary mode, consecutive id of 0 are merged into one 0. Under text mode, no space are inserted between unknown-words.

Releases

8 releases since Debian 7 (Wheezy); the text changed 7 times.

  1. 7
  2. 8
  3. 9
  4. 10
  5. 11
  6. 12
  7. 13
  8. Arch

Author

Originally written by Phill.Zhang <[email protected]>. Currently maintained by Kov.Chai <[email protected]>.

From sunpinyin 3.0.0rc2-3 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.