Packages

o

fm.common

Normalize

object Normalize

Source
Normalize.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Normalize
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. def lowerAlphaNumericWords(s: String, buf: Builder[String, _]): Unit
  12. def lowerAlphaNumericWords(s: String): Array[String]
  13. def lowerAlphanumeric(s: String): String

    Removes any non-alphanumeric characters and strips accents (when it can be converted to a single character) - Only allocates a new string if the passed in string is not already normalized

    Removes any non-alphanumeric characters and strips accents (when it can be converted to a single character) - Only allocates a new string if the passed in string is not already normalized

    Note: This logic should match reverseLowerAlphanumeric() -- EXCEPT that this implementation now only allocates if it needs to

  14. def lowerAlphanumericWithPositions(s: String): (String, Array[Int])

    Removes any non-alphanumeric characters and strips accents (when it can be converted to a single character) - Only allocates a new string if the passed in string is not already normalized

    Removes any non-alphanumeric characters and strips accents (when it can be converted to a single character) - Only allocates a new string if the passed in string is not already normalized

    Note: This logic should match reverseLowerAlphanumeric() -- EXCEPT that this implementation now only allocates if it needs to

  15. def lowerAlphanumericWithSpaces(s: String): String

    Replaces any non-alphanumeric characters with collapsed spaces

  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. def numeric(s: String): String
  20. def reverseLowerAlphanumeric(original: String, normalized: String): Option[String]

    Given the original string and a normalized substring, extract the original version of the normalized substring.

    Given the original string and a normalized substring, extract the original version of the normalized substring. e.g. Original: "Foo B.O.S.C.H. Bar" Normalized: "bosch" Result: "B.O.S.C.H."

    Note: This logic should match lowerAlphanumeric

  21. def stripAccents(s: String): String
  22. def stripControl(s: String): String
  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. def toFullWidth(s: String): String

    Converts ASCII Characters in a String to their Unicode Full Width equivalent

  25. def toFullWidth(ch: Char): Char

    Converts an ASCII Character to it's Unicode Full Width equivalent

    Converts an ASCII Character to it's Unicode Full Width equivalent

    Examples:

    val a = (33 to 126).map{ _.toChar }
    // a: scala.collection.immutable.IndexedSeq[Char] = Vector(!, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, @, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, [, \, ], ^, _, `, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, {, |, }, ~)
    val b = (65281 to 65374).map{ _.toChar }
    // b: scala.collection.immutable.IndexedSeq[Char] = Vector(!, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, @, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, [, \, ], ^, _, `, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, {, |, }, ~)
    (a zip b)
    // res44: scala.collection.immutable.IndexedSeq[(Char, Char)] = Vector((!,!), (","), (#,#), ($,$), (%,%), (&,&), (','), ((,(), (),)), (*,*), (+,+), (,,,), (-,-), (.,.), (/,/), (0,0), (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8), (9,9), (:,:), (;,;), (<,<), (=,=), (>,>), (?,?), (@,@), (A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z), ([,[), (\,\), (],]), (^,^), (_,_), (`,`), (a,a), (b,b), (c,c), (d,d), (e,e), (f,f), (g,g), (h,h), (i,i), (j,j), (k,k), (l,l), (m,m), (n,n), (o,o), (p,p), (q,q), (r,r), (s,s), (t,t), (u,u), (v,v), (w,w), (x,x), (y,y), (z,z), ({,{), (|,|), (},}), (~,~))
  26. def toString(): String
    Definition Classes
    AnyRef → Any
  27. def urlName(raw: String): String

    Transform the string into something that is URL Friendly.

  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped