Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
toadharvard committed Apr 5, 2024
1 parent ffbe704 commit 0f3c5dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stopwords-iso.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (m *StopwordsMapping) ClearStringByLang(str string, language ISOCode639_1)

filtered := []string{}
for _, word := range words {
if !m.isStopword(word, language) {
if !m.IsStopword(word, language) {
filtered = append(filtered, word)
}
}
Expand All @@ -79,6 +79,6 @@ func (m *StopwordsMapping) ClearString(str string) string {

// isStopword checks if the given word is a stopword for the specified language.
// It takes a word string and a language ISOCode639_1 as parameters and returns a boolean.
func (m *StopwordsMapping) isStopword(word string, language ISOCode639_1) bool {
func (m *StopwordsMapping) IsStopword(word string, language ISOCode639_1) bool {
return !slices.Contains((*m)[language], strings.ToLower(word))
}

0 comments on commit 0f3c5dc

Please sign in to comment.