Run aspell on manpage

南楼画角 提交于 2021-02-11 04:52:33

问题


I want use Aspell on man page but i have problem with word splitting. I use man man | col -bx | aspell (...) but "man man | col -bx " return text with spitted words i.e:

"man formats and displays the on-line man-
ual pages. If you specify section, man on-
ly looks in that section of the manual."

So Aspell return this words as wrong.

Any ideas how switch it off?


回答1:


You want to format the man pages without hyphenation. This should do it:

 groff -mtty-char -Tutf8 -man -rHY=0 /usr/share/man/man1/man.1

Alternatively tell it the page is so wide that it never hyphenates:

 groff -mtty-char -Tutf8 -man -rLL=1000000 /usr/share/man/man1/man.1

And now some explanation, so you know where to find this stuff. man formats pages with nroff, which is just a script around groff. You can find out what that does with:

sh -x $(which nroff) -man /usr/share/man/man1/man.1

This in turn will spit out a groff command similar to the one above. You can then find out what groff does internally with -V:

groff -mtty-char -Tutf8 -man -V /usr/share/man/man1/man.1

...and find out about the hyphenation flags I used with

man groff_man


来源:https://stackoverflow.com/questions/22712319/run-aspell-on-manpage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!