fork download
  1. function matchsent(text)
  2. text = string.gsub(text, '%.%s+(%u)', '.§%1')
  3. for sent in string.gmatch(text, '[^§]+') do
  4. print(sent)
  5. print("---")
  6. end
  7. end
  8. matchsent("Dr.Bonn was hiding in a tree.\nAnother one.")
Success #stdin #stdout 0s 2844KB
stdin
Standard input is empty
stdout
Dr.Bonn was hiding in a tree.
---
Another one.
---