xlcnd / isbnlib

python library to validate, clean, transform and get metadata of ISBN strings (for devs).
Other
229 stars 30 forks source link

dashes in isbns cause problem in normal level #107

Closed C7DAFBB7 closed 2 years ago

C7DAFBB7 commented 2 years ago

Whenever a string contains '-97' get_isbnlike() returns wonky results in normal level.

For example for "Fashion 101 - A Crash Course in Clothing"

isbnlib.get_isbnlike('978-0-9790173-4-6', level='normal') => ['9790173-4-6']

which should return ['978-0-9790173-4-6'] or possibly ['978-0-9790173-4-6', '9790173-4-6']

for 'Superbritánico and the Queen's Birthday'

isnblib.getisbnlike(''978-9788461784') => ['9788461784']

The problem seems to be caused by this bit of code introduced to solve issue #60

    text = text.replace('-97', '- 97')

Thank you

xlcnd commented 2 years ago

Thanks! It is 'fixed'!