मैंने पाया मैं निम्नलिखित नॉर्मलाइज़र
import org.scalactic._
val whiteSpaceNormalised: Uniformity[String] =
new AbstractStringUniformity {
/**Returns the string with all consecutive white spaces reduced to a single space.*/
def normalized(s: String): String = s.replaceAll("\\s+", " ")
override def toString: String = "whiteSpaceNormalised"
}
परीक्षण बनाई http://www.scalatest.org/user_guide/using_matchers
import org.scalatest.Matchers._
import org.scalactic.Explicitly._
import org.scalactic.StringNormalizations._
"Hi" should equal ("hi") (after being lowerCased)
पर केस संवेदी तुलना के लिए कुछ सामान्य है कि वहाँ बहु लाइन के लिए अब
import org.scalatest.Matchers._
import org.scalactic.Explicitly._
import org.scalactic.StringNormalizations._
" aaa \n \n\r bbb " should equal("\naaa bbb \t")(after being whiteSpaceNormalised)
है स्ट्रिंग्स, आप '' 'डीफ सामान्यीकृत (एस: स्ट्रिंग): स्ट्रिंग = s.replaceAll ("(? s) \\ s +", "") .trim''' – botkop