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 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..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,11 +67,11 @@ private String[] getValidLabelList(String[] inputLabelList) for(String label : inputLabelList) { - String buffer = label.replace(" ", ""); + String buffer = label.replaceAll("\\s", ""); if(buffer.length() > 0) { - validLabelList.add(label); + validLabelList.add(buffer); } }