本文整理匯總了Golang中github.com/kljensen/snowball/snowballword.SnowballWord.FirstSuffixIfIn方法的典型用法代碼示例。如果您正苦於以下問題:Golang SnowballWord.FirstSuffixIfIn方法的具體用法?Golang SnowballWord.FirstSuffixIfIn怎麽用?Golang SnowballWord.FirstSuffixIfIn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/kljensen/snowball/snowballword.SnowballWord
的用法示例。
在下文中一共展示了SnowballWord.FirstSuffixIfIn方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: step3
// Step 3 is the removal of residual suffixes.
//
func step3(word *snowballword.SnowballWord) bool {
suffix, suffixRunes := word.FirstSuffixIfIn(word.RVstart, len(word.RS),
"os", "a", "o", "á", "í", "ó", "e", "é",
)
// No suffix found, nothing to do.
//
if suffix == "" {
return false
}
// Remove all these suffixes
word.RemoveLastNRunes(len(suffixRunes))
if suffix == "e" || suffix == "é" {
// If preceded by gu with the u in RV delete the u
//
guSuffix, _ := word.FirstSuffix("gu")
if guSuffix != "" {
word.RemoveLastNRunes(1)
}
}
return true
}