Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.

add pattern and test for greek license plates #69

Merged
merged 3 commits into from
Oct 14, 2018
Merged

add pattern and test for greek license plates #69

merged 3 commits into from
Oct 14, 2018

Conversation

sp1thas
Copy link
Contributor

@sp1thas sp1thas commented Oct 14, 2018

No description provided.

Copy link
Collaborator

@denisorehovsky denisorehovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Looks good. Just a few comments to look into here.

'FR': r'(^[A-Z]{2}-\d{3}-[A-Z]{2}$)|(^\d{1,4}\s[A-Z]{1,3}\s\d{2}$)'
'FR': r'(^[A-Z]{2}-\d{3}-[A-Z]{2}$)|(^\d{1,4}\s[A-Z]{1,3}\s\d{2}$)',
# Regex pattern to match Greek license plates
'GR': r'(^[ABEZHIKMNOPTYXΑΒΕΖΗΙΚΜΝΟΡΤΥΧ]{3}-\d{4})',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify please why did you repeat ABEZHIKMNOPTYX two times here?

Copy link
Contributor Author

@sp1thas sp1thas Oct 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two groups looks the same but the second contains greek characters in order to detect greek licence plate with greek characters.

>>> a = 'ABEZHIKMNOPTYXΑΒΕΖΗΙΚΜΝΟΡΤΥΧ'
>>> for latin_char, greek_char in zip(a[:14], a[14:]):
...     print(latin_char, ord(latin_char), greek_char, ord(greek_char))
... 
A 65 Α 913
B 66 Β 914
E 69 Ε 917
Z 90 Ζ 918
H 72 Η 919
I 73 Ι 921
K 75 Κ 922
M 77 Μ 924
N 78 Ν 925
O 79 Ο 927
P 80 Ρ 929
T 84 Τ 932
Y 89 Υ 933
X 88 Χ 935

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, ok. Thanks. Greek characters are not visible to me.

tests/test_patterns.py Outdated Show resolved Hide resolved
tests/test_patterns.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 14, 2018

Codecov Report

Merging #69 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #69   +/-   ##
=======================================
  Coverage   96.07%   96.07%           
=======================================
  Files           4        4           
  Lines          51       51           
=======================================
  Hits           49       49           
  Misses          2        2
Impacted Files Coverage Δ
expynent/patterns.py 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6bf03f...ea3b699. Read the comment docs.

@denisorehovsky
Copy link
Collaborator

@lk-geimfari There is something wrong with our CI. I think we can merge this guy but then create another PR with fixes.

@lk-geimfari
Copy link
Owner

@apirobot Feel free to manage this repository. Merge it!

@denisorehovsky denisorehovsky merged commit ef22388 into lk-geimfari:master Oct 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants