From ae931507063ab72d461f32a6c22c85e20716b5d3 Mon Sep 17 00:00:00 2001 From: Dom <97384583+tosemml@users.noreply.github.com> Date: Tue, 22 Aug 2023 23:07:34 -0700 Subject: [PATCH 1/3] use join --- underthesea/utils/col_external_dictionary.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/underthesea/utils/col_external_dictionary.py b/underthesea/utils/col_external_dictionary.py index b9565301..4a00f690 100644 --- a/underthesea/utils/col_external_dictionary.py +++ b/underthesea/utils/col_external_dictionary.py @@ -26,11 +26,8 @@ def __init__(self, word, senses=[]): self.senses = senses def __str__(self): - content = self.word + " " - for sense in self.senses: - content += sense.tag + "," - return content - + return self.word + " " + ",".join([sense.tag for sense in self.senses]) + def add_sense(self, sense): self.senses.append(sense) From 41717007703a46ab7347208ef6556f9f18565f75 Mon Sep 17 00:00:00 2001 From: Dom <97384583+tosemml@users.noreply.github.com> Date: Tue, 5 Sep 2023 22:27:39 -0700 Subject: [PATCH 2/3] Remove white space --- underthesea/utils/col_external_dictionary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/underthesea/utils/col_external_dictionary.py b/underthesea/utils/col_external_dictionary.py index 4a00f690..747aa359 100644 --- a/underthesea/utils/col_external_dictionary.py +++ b/underthesea/utils/col_external_dictionary.py @@ -27,7 +27,7 @@ def __init__(self, word, senses=[]): def __str__(self): return self.word + " " + ",".join([sense.tag for sense in self.senses]) - + def add_sense(self, sense): self.senses.append(sense) From f3f5d003d03a5ae105cc5ac3d7276d3f1253955a Mon Sep 17 00:00:00 2001 From: Dom <97384583+tosemml@users.noreply.github.com> Date: Wed, 6 Sep 2023 22:19:11 -0700 Subject: [PATCH 3/3] fix bug --- underthesea/utils/col_external_dictionary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/underthesea/utils/col_external_dictionary.py b/underthesea/utils/col_external_dictionary.py index 747aa359..4d82f0dc 100644 --- a/underthesea/utils/col_external_dictionary.py +++ b/underthesea/utils/col_external_dictionary.py @@ -26,7 +26,7 @@ def __init__(self, word, senses=[]): self.senses = senses def __str__(self): - return self.word + " " + ",".join([sense.tag for sense in self.senses]) + return self.word + " " + ",".join([sense.tag for sense in self.senses]) + "," def add_sense(self, sense): self.senses.append(sense)