code: func (c *ContentSpec) TruncateWordsToWholeSentence(s string) (string, bool) {
  	var (
  		wordCount     = 0
  		lastWordIndex = -1
  	)
  
  	for i, r := range s {
  		if unicode.IsSpace(r) {
  			wordCount++
  			lastWordIndex = i
  
  			if wordCount >= c.summaryLength {
  				break
  			}
  
  		}
  	}
  
  	if lastWordIndex == -1 {
  		return s, false
  	}
  
  	endIndex := -1
  
  	for j, r := range s[lastWordIndex:] {
  		if isEndOfSentence(r) {
  			endIndex = j + lastWordIndex + utf8.RuneLen(r)
  			break
  		}
  	}
  
  	if endIndex == -1 {
  		return s, false
  	}
  
  	return strings.TrimSpace(s[:endIndex]), endIndex < len(s)
  }
docs: // TruncateWordsToWholeSentence takes content and truncates to whole sentence
  // limited by max number of words. It also returns whether it is truncated.