Closing gaps in text