diff --git a/yaboli/basic_types.py b/yaboli/basic_types.py index 8f31a69..5ba0110 100644 --- a/yaboli/basic_types.py +++ b/yaboli/basic_types.py @@ -1,8 +1,5 @@ import time -def mention(name): - return "".join(c for c in name if not c in ".!?;&<'\"" and not c.isspace()) - class SessionView(): """ This class keeps track of session details. diff --git a/yaboli/utils.py b/yaboli/utils.py new file mode 100644 index 0000000..a3e3a4c --- /dev/null +++ b/yaboli/utils.py @@ -0,0 +1,21 @@ +def mention(name): + """ + mention(name) -> name + + Removes all whitespace and some special characters from the name, + such that the resulting name, if prepended with a "@", will mention the user. + """ + + return "".join(c for c in name if not c in ".!?;&<'\"" and not c.isspace()) + +def reduce_name(name): + """ + reduce_name(name) -> name + + Reduces a name to a form which can be compared with other such forms. + If two such forms are equal, they are both mentioned by the same @mentions, + and should be considered identical when used to identify users. + """ + + #TODO: implement + pass