Commits

Anonymous committed 5da17a7

Append an s to currency names unless the next word is "loan"

Comments (0)

Files changed (1)

         # token is an ISO currency abbreviation. Make new tokens to
         # replace it
         iso_letters = token.str.upper()
-        new_token_str = '{} ( {} )'.format(
+        if right_of_split and right_of_split[0].str == u'loan':
+            new_token_str_fmt = '{} ( {} )'
+        else:
+            new_token_str_fmt = '{}s ( {} )'
+        new_token_str = new_token_str_fmt.format(
             pycountry.currencies.get(letter=iso_letters).name,
             iso_letters)
         new_tokens = map(Token, new_token_str.split())