zhangbo před 3 měsíci
rodič
revize
2a951976e3
1 změnil soubory, kde provedl 9 přidání a 1 odebrání
  1. 9 1
      udf/udf_python.py

+ 9 - 1
udf/udf_python.py

@@ -333,4 +333,12 @@ class clean_text(object):
         if input_text is None:
             return ""
         cleaned_text = self.re.sub(r"[^\u4e00-\u9fa5a-zA-Z0-9]", "", input_text)
-        return "" if cleaned_text is None else cleaned_text
+        return "" if cleaned_text is None else cleaned_text
+
+@annotate("string->string")
+class deduplication4list(object):
+    def evaluate(self, input_text):
+        if input_text is None:
+            return None
+        result = list(set(input_text.split(",")))
+        return ",".join(result)