docbook-apps

  • 1.  DocBook Spelling Aid

    Posted 06-26-2010 12:25
    While working on my large set of docbook source files, which I've
    converted from the original html source, I discovered the need for a
    tool to check the spelling. I bashed together a Perl wrapper around
    the program 'hunspell' so the program can be run against a set of
    files, read the output, eliminate unnecessary lines, and use a hash to
    eliminate duplicates.

    I'm sure it can be improved, but I leave that as an exercise for the
    user. I uploaded it to the DocBook wiki at the bottom of this page:

    http://wiki.docbook.org/topic/ConvenienceTools#preview

    The Perl program is called "check_spelling.pl" and a limited help
    message is shown if you execute it without any arguments.

    Regards,

    -Tom

    Thomas M. Browder, Jr.
    Niceville, Florida
    USA



  • 2.  Re: [docbook-apps] DocBook Spelling Aid

    Posted 06-27-2010 09:43
    Am 26.06.2010 15:24, schrieb Tom Browder:
    > While working on my large set of docbook source files, which I've
    > converted from the original html source, I discovered the need for a
    > tool to check the spelling. I bashed together a Perl wrapper around
    > the program 'hunspell' so the program can be run against a set of
    > files, read the output, eliminate unnecessary lines, and use a hash to
    > eliminate duplicates.
    >
    > I'm sure it can be improved, but I leave that as an exercise for the
    > user. I uploaded it to the DocBook wiki at the bottom of this page:
    >
    > http://wiki.docbook.org/topic/ConvenienceTools#preview
    >
    > The Perl program is called "check_spelling.pl" and a limited help
    > message is shown if you execute it without any arguments.

    You mean like :)
    aspell check --mode=sgml doc.xml

    Stefan


    >
    > Regards,
    >
    > -Tom
    >
    > Thomas M. Browder, Jr.
    > Niceville, Florida
    > USA
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >




  • 3.  Re: [docbook-apps] DocBook Spelling Aid

    Posted 06-27-2010 10:32
    On Sun, Jun 27, 2010 at 04:43, Stefan Kost <ensonic@hora-obscura.de> wrote:
    > Am 26.06.2010 15:24, schrieb Tom Browder:
    ...
    > You mean like :)
    > aspell check --mode=sgml doc.xml

    Something like that, but that line doesn't work for me.

    The reason for the wrapper is I couldn't find any way to handle
    multiple files non-interactively. Of course a better solution is
    always sought--suggestions welcome.

    Regards,

    -Tom



  • 4.  Re: [docbook-apps] DocBook Spelling Aid

    Posted 06-27-2010 10:48
    On Sun, Jun 27, 2010 at 05:32, Tom Browder <tom.browder@gmail.com> wrote:
    > On Sun, Jun 27, 2010 at 04:43, Stefan Kost <ensonic@hora-obscura.de> wrote:
    >> Am 26.06.2010 15:24, schrieb Tom Browder:
    > ...
    >> You mean like :)
    >> aspell check --mode=sgml doc.xml

    I get it, I could have used aspell instead of hunspell and specifying
    the English system dictionary,

    Hunspell was the first thing I saw when running apropos on my machine
    to look for a spelling program--didn't think to look further. I
    forgot about aspell--been a loooong time since I used an external
    spell checker

    At any rate, aspell should work with my wrapper with suitable command
    line changes. It will still help eliminate the cruft and simplify
    spell checking a large set of files.

    Thanks.

    Regards,

    -Tom



  • 5.  Re: [docbook-apps] DocBook Spelling Aid

    Posted 06-27-2010 15:17
    On Sun, Jun 27, 2010 at 12:47 PM, Tom Browder <tom.browder@gmail.com> wrote:
    > On Sun, Jun 27, 2010 at 05:32, Tom Browder <tom.browder@gmail.com> wrote:
    >> On Sun, Jun 27, 2010 at 04:43, Stefan Kost <ensonic@hora-obscura.de> wrote:
    >>> Am 26.06.2010 15:24, schrieb Tom Browder:
    >> ...
    >>> You mean like :)
    >>> aspell check --mode=sgml doc.xml
    >
    > I get it, I could have used aspell instead of hunspell and specifying
    > the English system dictionary,
    >
    > Hunspell was the first thing I saw when running apropos on my machine
    > to look for a spelling program--didn't think to look further.  I
    > forgot about aspell--been a loooong time since I used an external
    > spell checker
    >
    > At any rate, aspell should work with my wrapper with suitable command
    > line changes.  It will still help eliminate the cruft and simplify
    > spell checking  a large set of files.

    Here is my two cents:

    xmllint --postvalid --xinclude --nonet ${input_file} | aspell
    list -p path/to/aspell.en.pws --mode=sgml --lang=en --encoding=utf-8

    Because this trigger quite a lot of false positive I also append:

    foreach( skip in `acronym application author code
    hardware filename markup programlisting
    productname screen sgmltag`)
    "--add-f-sgml-skip=${skip}"
    endforeach()

    HTH
    --
    Mathieu



  • 6.  Re: [docbook-apps] DocBook Spelling Aid

    Posted 06-27-2010 16:50
    On Sun, Jun 27, 2010 at 10:16, Mathieu Malaterre
    <mathieu.malaterre@gmail.com> wrote:
    > On Sun, Jun 27, 2010 at 12:47 PM, Tom Browder <tom.browder@gmail.com> wrote:
    >> On Sun, Jun 27, 2010 at 05:32, Tom Browder <tom.browder@gmail.com> wrote:
    >>> On Sun, Jun 27, 2010 at 04:43, Stefan Kost <ensonic@hora-obscura.de> wrote:
    >>>> Am 26.06.2010 15:24, schrieb Tom Browder:
    ...
    > Here is my two cents:
    >
    >      xmllint --postvalid --xinclude --nonet ${input_file} | aspell
    ...

    I don't do that because I want to treat the spelling check as a separate task.

    -Tom



  • 7.  Re: [docbook-apps] DocBook Spelling Aid

    Posted 06-27-2010 18:15
    Am 27.06.2010 18:16, schrieb Mathieu Malaterre:
    > On Sun, Jun 27, 2010 at 12:47 PM, Tom Browder <tom.browder@gmail.com> wrote:
    >> On Sun, Jun 27, 2010 at 05:32, Tom Browder <tom.browder@gmail.com> wrote:
    >>> On Sun, Jun 27, 2010 at 04:43, Stefan Kost <ensonic@hora-obscura.de> wrote:
    >>>> Am 26.06.2010 15:24, schrieb Tom Browder:
    >>> ...
    >>>> You mean like :)
    >>>> aspell check --mode=sgml doc.xml
    >>
    >> I get it, I could have used aspell instead of hunspell and specifying
    >> the English system dictionary,
    >>
    >> Hunspell was the first thing I saw when running apropos on my machine
    >> to look for a spelling program--didn't think to look further. I
    >> forgot about aspell--been a loooong time since I used an external
    >> spell checker
    >>
    >> At any rate, aspell should work with my wrapper with suitable command
    >> line changes. It will still help eliminate the cruft and simplify
    >> spell checking a large set of files.
    >
    > Here is my two cents:
    >
    > xmllint --postvalid --xinclude --nonet ${input_file} | aspell
    > list -p path/to/aspell.en.pws --mode=sgml --lang=en --encoding=utf-8
    >
    > Because this trigger quite a lot of false positive I also append:
    >
    > foreach( skip in `acronym application author code
    > hardware filename markup programlisting
    > productname screen sgmltag`)
    > "--add-f-sgml-skip=${skip}"
    > endforeach()
    >
    > HTH

    I use a local dictionary for the exceptions. This is the whole rule in my makefile:

    check-local:
    @echo "Spellchecking C/$(DOC_MODULE).xml..."
    if test 0 -ne `cat $(srcdir)/C/$(DOC_MODULE).xml | aspell list --lang=en_US -p
    $(PWD)/$(srcdir)/C/aspell.pws --mode=sgml | wc -l`; then \
    echo; \
    echo "C/$(DOC_MODULE).xml doesn't pass spellchecking, please fix with" >&2; \
    echo " aspell check --lang=en_US -p ./C/aspell.pws --mode=sgml
    C/$(DOC_MODULE).xml" >&2; \
    echo; \
    false; \
    else \
    echo " done"; \
    fi