NAME

Koha::QA::Spelling - Centralized spell checking using codespell

SYNOPSIS

use Koha::QA::Spelling;

# With a file
my $checker = Koha::QA::Spelling->new({file => $file_path, ignore_file => $ignore_file});

# Or with content directly
my $checker = Koha::QA::Spelling->new({content => $file_content, ignore_file => $ignore_file});

my $is_valid = $checker->check;
my @errors = $checker->errors;

DESCRIPTION

This module provides centralized spell checking using codespell.

METHODS

new

my $checker = Koha::QA::Spelling->new({file => $file_path, ignore_file => $ignore_file});

Creates a new Spelling checker instance. Accepts either a 'file' parameter (path to a file) or a 'content' parameter (string content).

check

my $is_valid = $checker->check;

Checks a file for spelling errors using codespell.

errors

my @errors = $checker->errors;

Returns array of error hashrefs, each with: - file: The file path - message: The spelling error message