Closed neelsmith closed 5 years ago
currently only doing mapping when sigma is followed by space
val uc:String = [Some string with possibly messed up sigmas]
val sigmaTerminators:Vector[String] = Vector(",",".",":", ";", "'", "—", " ", "\t")
val matcher = "σ.".r
val stringWithFixedSigmas = {
matcher.replaceAllIn(uc, m => {
val secondChar:String = m.group(0).tail
if (sigmaTerminators.contains(secondChar)) { s"ς${secondChar}"}
else { s"σ${secondChar}"}
})
}
I've been working with this library a bit lately. The above code is what I've implemented on an ad hoc basis to sort out sigmas.
Fixed and tested.
Map s + [space, punctuation or final position] to terminal sigma