diff --git a/composer.json b/composer.json index c7ad529..4433d4f 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "werk365/identitydocuments", "description": "Package to parse identity documents like passports", "license": "GPL-3.0-or-later", - "version": "2.0.2", + "version": "2.0.3", "authors": [ { "name": "Hergen Dillema", diff --git a/src/Viz/VizParser.php b/src/Viz/VizParser.php index 86107ed..a357535 100644 --- a/src/Viz/VizParser.php +++ b/src/Viz/VizParser.php @@ -7,6 +7,7 @@ class VizParser extends Viz private array $viz = [ 'first_name' => [], 'last_name' => null, + 'document_number' => null, ]; public function match(array $parsed, string $mrz, string $text): array @@ -47,6 +48,9 @@ public function match(array $parsed, string $mrz, string $text): array $lastNameScore = $this->compare($parsed['last_name'], $lastName); $this->viz['last_name']['confidence'] = $lastNameScore; } + if (strpos($word, preg_replace('/viz['document_number']['value'] = $word; + } foreach ($parsed['first_name'] as $key => $first_name) { if (! isset($firstNameScore[$key])) { $firstNameScore[$key] = 0.4;