NAME

Lingua::AtD::Metric - Encapsulates the grammar/spelling/style/statistical Metrics contained in Scores.

VERSION

version 1.121550

SYNOPSIS

use Lingua::AtD;

# Create a new service proxy
my $atd = Lingua::AtD->new( {
    host => 'service.afterthedeadline.com',
    port => 80
});

# Run spelling and grammar checks. Returns a Lingua::AtD::Response object.
my $doc_check = $atd->check_document('Text to check.');
# Loop through reported document errors.
foreach my $atd_error ($doc_check->get_errors()) {
    # Do something with...
    print "Error string: ", $atd_error->get_string(), "\n";
}

# Run only grammar checks. Essentially the same as
# check_document(), sans spell-check.
my $grmr_check = $atd->check_grammar('Text to check.');
# Loop through reported document errors.
foreach my $atd_error ($grmr_check->get_errors()) {
    # Do something with...
    print "Error string: ", $atd_error->get_string(), "\n";
}

# Get statistics on a document. Returns a Lingua::AtD::Scores object.
my $atd_scores = $atd->stats('Text to check.');
# Loop through reported document errors.
foreach my $atd_metric ($atd_scores->get_metrics()) {
    # Do something with...
    print $atd_metric->get_type(), "/", $atd_metric->get_key(),
        " = ", $atd_metric->get_value(), "\n";
}

DESCRIPTION

Encapsulates the grammar/spelling/style/statistical Metrics contained in Scores.

METHODS

get_type

$atd_metric->get_type();

Returns a string indicating the type of metric. One of grammar, spell, style, or stats.

get_key

$atd_metric->get_key();

Returns a string indicating the metric key. From the API Documentation: The type is a category to add some organization to the information.

get_value

$atd_metric-The type is a category to add some organization to the information.>get_value();

Returns the numeric value of the metric.

METHODS

SEE ALSO

See the API Documentation at After the Deadline's website.

AUTHOR

David L. Day <dday376@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by David L. Day.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.