This string is missing a digit.
\n"); echo("Attempting error correction by single digit insertion.\n"); } elseif (strlen($clean) == 10) { echo("
This string has an error in at least one position.
\n"); echo("Attempting error correction by single character " . "replacement or pairwise transposition.\n"); } else { echo("
This string has an extraneous character.
\n"); echo("Attempting error correction by single character deletion.\n"); } echo("
\n"); $corrections = generate_ISBN_corrections($clean); foreach ($corrections as $newISBN => $dummy) { if (is_assigned($newISBN)) $correction_text .= 'Sorry, no correction is possible.\n
"); } else { echo("The following valid ISBNs have been generated.
\n"); echo("The string is ISBN-checksum correct!
\n"); $canon = canonical_ISBN($clean); $codes = split("-", $canon); if (sizeof($codes) == 4) { if ((strlen($original) > 10) && (str_replace("x", "X", $original) != $canon)) { echo("Hyphenation error: hyphenation ignored.
\n"); } echo("Try the bibp link: bibp:ISBN/' . $canon . "!
\n"); } else { echo("This ISBN is in an unassigned range!
"); echo("This string appears to be an ISBN encoded as a Bookland EAN.\n"); $ISBN_proto = substr($ISBN_proto, 3, strlen($ISBN_proto) - 4); $ISBN_proto .= make_checkdigit(mod11_checksum($ISBN_proto, 10)); echo("Computing ISBN string for analysis: $ISBN_proto
\n"); $clean = ISN_clean($ISBN_proto); $class = ISBN_classifier($clean); } if ($class == "checksumOK") analyze_and_report($ISBN_proto, $clean); else { echo("ISBN string under analysis: $clean
\n"); if ($class == "single_error") error_repair_and_report($clean); else { echo("This string "); if ($class == "short") echo("is too short to be an ISBN.\n"); elseif ($class == "short/invalid") echo("is too short to be an ISBN and contains invalid characters.\n"); elseif ($class == "long") echo("is too long to be an ISBN.\n"); elseif ($class == "long/invalid") echo("is too long to be an ISBN and contains invalid characters.\n"); elseif ($class == "invalid") echo("contains two or more invalid ISBN characters.\n"); echo("There are too many errors for error correction to be attempted.
\n"); } echo("An ISBN consists of 9 significant digits and a check digit.\n"); echo("The check digit may be 'X' or 'x' to represent a checksum of 10.\n"); echo("Optional embedded hyphens should reflect the internal structure consisting " . "of country/group code, publisher code, book code and check digit.\n"); echo("
"); } } ?>