I have a text that I need to split in subsentences but if the text contains special cases such as domain.com or st. moris it gets splitted at those points too.
Here is what I got:
val pattern = "(?<=[.](?<![s][t][.]))"
val text = "here is an axample with cases like st. moris and google.com here. second sentence."
val list = text.split(pattern)
list.foreach(println)
I want this code to return
List(
"here is an axample with cases like st. moris and google.com here.",
"second sentence."
)
but instead it returns:
List(
"here is an axample with cases like st.",
" moris and google.",
"com here.",
"second sentence."
)
How can I make it work?
