Github user maropu commented on a diff in the pull request:
https://github.com/apache/spark/pull/22048#discussion_r213869119
--- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
@@ -2794,6 +2794,27 @@ private[spark] object Utils extends Logging {
}
}
}
+
+ /**
+ * Regular expression matching full width characters
+ */
+ private lazy val fullWidthRegex = ("""[""" +
+ """\u1100-\u115F""" +
+ """\u2E80-\uA4CF""" +
+ """\uAC00-\uD7A3""" +
+ """\uF900-\uFAFF""" +
+ """\uFE10-\uFE19""" +
+ """\uFE30-\uFE6F""" +
+ """\uFF00-\uFF60""" +
+ """\uFFE0-\uFFE6""" +
+ """]""").r
+ /**
+ * Return the number of half width of a string
+ * A full width character occupies two half widths
+ */
--- End diff --
How about this?
```
/**
* Return the number of half widths in a given string. Note that a full
width character
* occupies two half widths.
*/
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]