From 06188c7fa0e46b5134feb639eff50f8e509c858f Mon Sep 17 00:00:00 2001 From: j Date: Mon, 9 Mar 2015 14:29:20 +0530 Subject: [PATCH] remove leading 0s --- oml/meta/dewey.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oml/meta/dewey.py b/oml/meta/dewey.py index fcbac58..581c18d 100644 --- a/oml/meta/dewey.py +++ b/oml/meta/dewey.py @@ -4,6 +4,8 @@ def get_classification(id): name = '%s' % id base = ''.join([s for s in id.split('/')[0].split('.')[0] if s.isdigit()]) + if base != '0': + base = base.lstrip('0') if base in DEWEY: name = '%s %s' % (name, DEWEY[base].decode('utf-8')) return name