From bb5d2ec0e6851b8000f27f37305dcd6aad43e5cb Mon Sep 17 00:00:00 2001 From: codenamewei Date: Mon, 5 Jul 2021 12:59:50 +0800 Subject: [PATCH 1/3] :bug: Bug fix for #437 --- .../src/main/java/ai/classifai/action/LabelListImport.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classifai-core/src/main/java/ai/classifai/action/LabelListImport.java b/classifai-core/src/main/java/ai/classifai/action/LabelListImport.java index 730feabb1..a6c935080 100644 --- a/classifai-core/src/main/java/ai/classifai/action/LabelListImport.java +++ b/classifai-core/src/main/java/ai/classifai/action/LabelListImport.java @@ -67,11 +67,11 @@ private String[] getValidLabelList(String[] inputLabelList) for(String label : inputLabelList) { - String buffer = label.replace(" ", ""); + String buffer = label.replaceAll("(\\r| )", "");; if(buffer.length() > 0) { - validLabelList.add(label); + validLabelList.add(buffer); } } From 3876dbe3387f89bbc64e8a65fcbf45b78da4d49e Mon Sep 17 00:00:00 2001 From: codenamewei <33477318+codenamewei@users.noreply.github.com> Date: Mon, 5 Jul 2021 13:05:08 +0800 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87044f0d8..d2cb294d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The detailed rules and walkthrough of writing a changelog is located [here](http ### Fixed - Fixed the display of full image path instead of intentional image name in Ubuntu and Mac OS [#446](https://github.com/CertifaiAI/classifai/issues/446) +- Bug fix for removing "\r" and spaces " " in imported labels [#437](https://github.com/CertifaiAI/classifai/issues/437) ## [2.0.0-alpha1] - 2021-02-26 ### Added From 1a30fc5dfdcd561287f60c27812edb51e9bc1e85 Mon Sep 17 00:00:00 2001 From: codenamewei Date: Mon, 5 Jul 2021 13:14:53 +0800 Subject: [PATCH 3/3] :recycle: Fix code smell --- .../src/main/java/ai/classifai/action/LabelListImport.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classifai-core/src/main/java/ai/classifai/action/LabelListImport.java b/classifai-core/src/main/java/ai/classifai/action/LabelListImport.java index a6c935080..cddbc226c 100644 --- a/classifai-core/src/main/java/ai/classifai/action/LabelListImport.java +++ b/classifai-core/src/main/java/ai/classifai/action/LabelListImport.java @@ -67,7 +67,7 @@ private String[] getValidLabelList(String[] inputLabelList) for(String label : inputLabelList) { - String buffer = label.replaceAll("(\\r| )", "");; + String buffer = label.replaceAll("\\s", ""); if(buffer.length() > 0) {