Split string into sentences - ignoring abbreviations for splitting

后端 未结 2 1241
無奈伤痛
無奈伤痛 2020-12-21 04:29

I\'m trying to split this string into sentences, but I need to handle abbreviations (which have the fixed format x.y. as a word:

content = \"Thi         


        
2条回答
  •  清歌不尽
    2020-12-21 05:17

    Given your example, I have managed to achieve what you are after through the use of this expression: (? (example here).

    This expression will look for period, question mark or exclamation mark characters which are not preceded by a character and a period.

    You would then need to replace them with the | character and finally, you replace the | with .\n.

提交回复
热议问题