snowballword/snowballword.go
func (w *SnowballWord) ReplaceSuffix(suffix, replacement string, force bool) bool {

	var (
		doReplacement bool
		suffixRunes   []rune
	)
	if force {
		doReplacement = true
		suffixRunes = []rune(suffix)
	} else {
		var foundSuffix string
		foundSuffix, suffixRunes = w.FirstSuffix(suffix)
		if foundSuffix == suffix {
			doReplacement = true
		}
	}
	if doReplacement == false {
		return false
	}
	w.ReplaceSuffixRunes(suffixRunes, []rune(replacement), true)
	return true
}
func (w *SnowballWord) ReplaceSuffix(suffix, replacement string, force bool) bool {

	var (
		doReplacement bool
		suffixRunes   []rune
	)
	if force {
		doReplacement = true
		suffixRunes = []rune(suffix)
	} else {
		var foundSuffix string
		foundSuffix, suffixRunes = w.FirstSuffix(suffix)
		if foundSuffix == suffix {
			doReplacement = true
		}
	}
	if doReplacement == false {
		return false
	}
	w.ReplaceSuffixRunes(suffixRunes, []rune(replacement), true)
	return true
}
// Replace a suffix and adjust R1start and R2start as needed.
// If `force` is false, check to make sure the suffix exists first.
//