diff --git a/pattern/text/en/abbreviation.py b/pattern/text/en/abbreviation.py new file mode 100644 index 00000000..f27cab17 --- /dev/null +++ b/pattern/text/en/abbreviation.py @@ -0,0 +1,10 @@ +def acronym_of(string): + # Empty string + acronym = '' + # For knowing where to split + previous = '' + for character in string: + if previous in " -" or previous.islower() and character.isupper(): + acronym += character.upper() + "." + previous = character + return acronym