+
+def person_name(text):
+ """ Converts "Name, Forename" to "Forename Name" """
+ if isinstance(text, list):
+ text = ''.join(text)
+ return Person.from_text(text).readable()
+
+
+def reg_person_name():
+ _register_function(person_name)
+
+
+def texcommand(text):
+ """Remove non-letters"""
+ if isinstance(text, list):
+ text = ''.join(text)
+ return re.sub(r'[^a-zA-Z]', '', text).strip()
+
+
+def reg_texcommand():
+ _register_function(texcommand)
+
+
+def reg_get(format_):
+ def get(*args):
+ obj = format_
+ for arg in args:
+ if hasattr(obj, arg):
+ obj = getattr(obj, arg)
+ else:
+ try:
+ obj = obj[arg]
+ except (TypeError, KeyError), e:
+ # Just raise proper AttributeError.
+ getattr(obj, arg)
+ return obj
+ _register_function(get)