From dbe9211963d9f004ab8046fc7773fca30e83ffe9 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz <henrik@levkowetz.com> Date: Sun, 10 Jun 2018 14:48:13 +0000 Subject: [PATCH] Tweaked unidecode_name() to not produce single-letter ascii surnames from non-ascii codepoints. The unidecode transliteration is in any case somewhat arbitrary, and in most cases a real person will tweak the ascii name of his account. When running tests, however, this tweak avoids some false test failures. And no, it's not simple to fix the draft author-extraction heuristics to deal well with single-letter surnames. - Legacy-Id: 15239 --- ietf/person/name.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ietf/person/name.py b/ietf/person/name.py index 26607d616..a936c87cc 100644 --- a/ietf/person/name.py +++ b/ietf/person/name.py @@ -107,6 +107,8 @@ def unidecode_name(uname): first = first.title() middle = ' '.join([ capfirst(p) for p in middle.split() ]) last = ' '.join([ capfirst(p) for p in last.split() ]) + if len(last) == 1: + last = (last+last).capitalize() # Restore the particle, if any if particle and last.startswith(capfirst(particle)+' '): last = ' '.join([ particle, last[len(particle)+1:] ])