Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kentnl/comment-spell-check
Check words from Comment::Spell vs a system spell checker
https://github.com/kentnl/comment-spell-check
Last synced: 4 days ago
JSON representation
Check words from Comment::Spell vs a system spell checker
- Host: GitHub
- URL: https://github.com/kentnl/comment-spell-check
- Owner: kentnl
- License: other
- Created: 2014-09-29T17:21:13.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-08T14:38:57.000Z (over 7 years ago)
- Last Synced: 2023-08-20T22:14:12.230Z (about 1 year ago)
- Language: Perl
- Size: 80.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.mkdn
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Comment::Spell::Check - Check words from Comment::Spell vs a system spell checker.
# VERSION
version 0.002002
# OVERVIEW
This module is similar to Test::Spelling and Pod::Spell, except it uses Comment::Spell,
and is more oriented for use as a library, that could be used to write a test.It also does something neither Test::Spelling or Pod::Spell presently can do: report line numbers
and per-line error counts for each source file read.# Spelling report to STDOUT by default
perl -MComment::Spell::Check -E'Comment::Spell::Check->new->parse_from_file(q[Foo.pm])'# Advanced Usage
my $speller = Comment::Spell::Check->new(
spell_command_exec => 'aspell' # override auto-detected default spelling engine
spell_command_args => [ '--lang=en_GB' ], # pass additional commands to spell checker
);my $buf;
$speller->set_output_string($buf);
my $result = $speller->parse_from_file("path/to/File.pm");
# $buf now contains report
# $result contains structured data that could be useful
# Example:
# {
# 'counts' => {
# 'abstraktion' => 4,
# 'bsaic' => 1,
# 'hmubug' => 2,
# 'incpetion' => 1,
# 'kepe' => 1,
# 'ssshtuff' => 1,
# 'thsi' => 1,
# 'tset' => 1,
# 'voreflow' => 1,
# 'warppying' => 1,
# 'wrods' => 1
# },
# 'fails' => [
# {
# 'counts' => {
# 'abstraktion' => 1
# },
# 'line' => 8
# },
# {
# 'counts' => {
# 'abstraktion' => 2
# },
# 'line' => 9
# },
# {
# 'counts' => {
# 'abstraktion' => 1,
# 'bsaic' => 1,
# 'hmubug' => 2,
# 'incpetion' => 1,
# 'kepe' => 1,
# 'ssshtuff' => 1,
# 'thsi' => 1,
# 'tset' => 1,
# 'voreflow' => 1,
# 'warppying' => 1,
# 'wrods' => 1
# },
# 'line' => 10
# }
# ]
# }I may eventually work out how to bolt line number parsing into Pod::Spell family, but at
present its hard due to the Pod::Parser underpinnings.# AUTHOR
Kent Fredric
# COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Kent Fredric .
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.