Skip to content

Commit

Permalink
Merge pull request #98 from navigating-stories/issue97
Browse files Browse the repository at this point in the history
os.linesep changed to \n
  • Loading branch information
eriktks committed Sep 26, 2024
2 parents be1ac11 + 00dac28 commit e242fb1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions orangecontrib/storynavigation/modules/actionanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ def __setup_required_nlp_resources(self, lang):
lang (string): the ISO code for the language of the input stories (e.g. 'nl' or 'en'). Currently only 'nl' and 'en' are supported
"""
if lang == constants.NL:
self.stopwords = constants.NL_STOPWORDS_FILE.read_text(encoding="utf-8").split(os.linesep)
self.stopwords = constants.NL_STOPWORDS_FILE.read_text(encoding="utf-8").split("\n")
else:
self.stopwords = constants.EN_STOPWORDS_FILE.read_text(encoding="utf-8").split(os.linesep)
self.stopwords = constants.EN_STOPWORDS_FILE.read_text(encoding="utf-8").split("\n")

self.stopwords = [item for item in self.stopwords if len(item) > 0]
6 changes: 3 additions & 3 deletions orangecontrib/storynavigation/modules/actoranalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@ def __setup_required_nlp_resources(self, lang):
lang (string): the ISO code for the language of the input stories (e.g. 'nl' or 'en'). Currently only 'nl' and 'en' are supported
"""
if lang == constants.NL:
self.stopwords = constants.NL_STOPWORDS_FILE.read_text(encoding="utf-8").split(os.linesep)
self.stopwords = constants.NL_STOPWORDS_FILE.read_text(encoding="utf-8").split("\n")
else:
self.stopwords = constants.EN_STOPWORDS_FILE.read_text(encoding="utf-8").split(os.linesep)
self.stopwords = constants.EN_STOPWORDS_FILE.read_text(encoding="utf-8").split("\n")

self.stopwords = [item for item in self.stopwords if len(item) > 0]
self.stopwords = [item for item in self.stopwords if len(item) > 0]
20 changes: 10 additions & 10 deletions orangecontrib/storynavigation/modules/tagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,19 +496,19 @@ def __setup_required_nlp_resources(self, lang):
lang (string): the ISO code for the language of the input stories (e.g. 'nl' or 'en'). Currently only 'nl' and 'en' are supported
"""
if lang == constants.NL:
self.stopwords = constants.NL_STOPWORDS_FILE.read_text(encoding="utf-8").split(os.linesep)
self.pronouns = constants.NL_PRONOUNS_FILE.read_text(encoding="utf-8").split(os.linesep)
self.stopwords = constants.NL_STOPWORDS_FILE.read_text(encoding="utf-8").split("\n")
self.pronouns = constants.NL_PRONOUNS_FILE.read_text(encoding="utf-8").split("\n")
self.model = constants.NL_SPACY_MODEL
self.past_tense_verbs = constants.NL_PAST_TENSE_FILE.read_text(encoding="utf-8").split(os.linesep)
self.present_tense_verbs = constants.NL_PRESENT_TENSE_FILE.read_text(encoding="utf-8").split(os.linesep)
self.false_positive_verbs = constants.NL_FALSE_POSITIVE_VERB_FILE.read_text(encoding="utf-8").split(os.linesep)
self.past_tense_verbs = constants.NL_PAST_TENSE_FILE.read_text(encoding="utf-8").split("\n")
self.present_tense_verbs = constants.NL_PRESENT_TENSE_FILE.read_text(encoding="utf-8").split("\n")
self.false_positive_verbs = constants.NL_FALSE_POSITIVE_VERB_FILE.read_text(encoding="utf-8").split("\n")
else:
self.stopwords = constants.EN_STOPWORDS_FILE.read_text(encoding="utf-8").split(os.linesep)
self.pronouns = constants.EN_PRONOUNS_FILE.read_text(encoding="utf-8").split(os.linesep)
self.stopwords = constants.EN_STOPWORDS_FILE.read_text(encoding="utf-8").split("\n")
self.pronouns = constants.EN_PRONOUNS_FILE.read_text(encoding="utf-8").split("\n")
self.model = constants.EN_SPACY_MODEL
self.past_tense_verbs = constants.EN_PAST_TENSE_FILE.read_text(encoding="utf-8").split(os.linesep)
self.present_tense_verbs = constants.EN_PRESENT_TENSE_FILE.read_text(encoding="utf-8").split(os.linesep)
self.false_positive_verbs = constants.EN_FALSE_POSITIVE_VERB_FILE.read_text(encoding="utf-8").split(os.linesep)
self.past_tense_verbs = constants.EN_PAST_TENSE_FILE.read_text(encoding="utf-8").split("\n")
self.present_tense_verbs = constants.EN_PRESENT_TENSE_FILE.read_text(encoding="utf-8").split("\n")
self.false_positive_verbs = constants.EN_FALSE_POSITIVE_VERB_FILE.read_text(encoding="utf-8").split("\n")

self.stopwords = [item for item in self.stopwords if len(item) > 0]
self.pronouns = [item for item in self.pronouns if len(item) > 0]
Expand Down

0 comments on commit e242fb1

Please sign in to comment.