diff --git a/README.rst b/README.rst index 63d1ad0..1e02813 100644 --- a/README.rst +++ b/README.rst @@ -51,6 +51,7 @@ Available languages ------------------- * Arabic +* Catalan * Danish * Dutch * English diff --git a/stop_words/__init__.py b/stop_words/__init__.py index 42a2ce2..40a45de 100644 --- a/stop_words/__init__.py +++ b/stop_words/__init__.py @@ -7,6 +7,7 @@ LANGUAGE_MAPPING = { 'ar': 'arabic', + 'ca': 'catalan', 'da': 'danish', 'nl': 'dutch', 'en': 'english', @@ -58,7 +59,7 @@ def get_stop_words(language): try: language_filename = '{0}{1}.txt'.format(STOP_WORDS_DIR, language) with open(language_filename, 'rb') as language_file: - stop_words = [line.strip().decode('utf-8') + stop_words = [line.decode('utf-8').strip() for line in language_file.readlines()] except IOError: raise StopWordError(