MMSEG(1)

πŸ’… MMSEG(1) β€” like, the mmseg manual but make it make sense πŸŽ€

okay so bestie, welcome to mmseg, a user-contributed Perl situation, and honestly? she's iconic. let's get into it ✨


✨ NAME ✨

mmseg β€” maximum matching segment Chinese text. that's it, that's the whole vibe. she takes Chinese text and chops it into words, no cap 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

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

like… you need the dict, the options are optional (as options are), and the corpus files are whatever you feel like throwing at her πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

mmseg is a tool for segmenting Chinese text into words using the maximum matching algorithm. periodt.

she segments corpus_file, or standard input if you didn't name a file (she's not picky, she's flexible 🫢), and writes the segmented result to standard output. in, chopped up, out. main character energy from start to finish πŸ‘‘


πŸ’– OPTIONS πŸ’–

  • -d dict_file β€” use dict_file as the lexicon, bestie. and if you don't have one handy, there's a default lexicon chillin' at /usr/share/sunpinyin-slm/dict.utf8 β€” she's already there waiting for you πŸ₯°
  • -f, --format (text|bin) β€” output format, and it can be 'text' or 'bin'. default is 'bin'. so like, normally: in text mode the actual word text gets output, while in binary mode a binary short integer of the word-ids gets written to stdout. two totally different aesthetics, both valid πŸ’«
  • -s, --stok STOK_ID β€” sentence token id. default 10. this lil cutie gets written to output in binary mode after every sentence, like a little period but make it numeric 🎯
  • -i, --show-id β€” show id info. under text output format mode, she attaches the id after known words; if you're under binary mode, she prints the id(s) in text. either way you're getting the receipts πŸ”
  • -a, --ambiguious-id AMBI-ID β€” okay so "ambiguious" (yes, that's how it's spelled, we love her for it πŸ’€) means ABC => A BC or AB C. if you specify it (AMBI-ID != 0), the sequence ABC will not be segmented. in binary mode the AMBI-ID is written out; in text mode <ambi>ABC</ambi> gets output. default is 0, i.e. she minding her own business πŸ™ˆ

🧚 NOTES 🧚

under binary mode, consecutive ids of 0 are merged into one 0. under text mode, no spaces are inserted between unknown-words. that's just how she rolls, don't @ her πŸ’€

🌈 AUTHOR 🌈

originally written by Phill.Zhang <phill.zhang@sun.com>. currently maintained by Kov.Chai <tchaikov@gmail.com>. legends, both of them πŸ‘‘πŸ’œ


⭐ SEE ALSO ⭐

slmseg(1), ids2ngram (1) β€” go read those too, iykyk πŸ“šβœ¨


okay that's the whole page, you're officially educated πŸŽ“πŸ’– this lil number was brought to you by perl v5.36.0 and dated 2023-08-08 β€” mwah, go segment something gorgeous πŸ“πŸ¦‹

πŸ“¦ where this page comes from