Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ISOCode639_1 ¶
type ISOCode639_1 = string
type StopwordsMapping ¶
func NewStopwordsMapping ¶
func NewStopwordsMapping() (StopwordsMapping, error)
NewStopwordsMapping initializes a new StopwordsMapping from a JSON file.
Returns: - StopwordsMapping: a map containing language to stopwords mapping. - error: an error object if an error occurred while reading or unmarshaling the JSON file.
func (*StopwordsMapping) ClearString ¶
func (m *StopwordsMapping) ClearString(str string) string
ClearString clears the given string by removing stopwords for all languages.
Parameters: - str: the string to be cleared.
Returns: - string: the cleared string.
func (*StopwordsMapping) ClearStringByLang ¶
func (m *StopwordsMapping) ClearStringByLang(str string, language ISOCode639_1) string
ClearStringByLang clears the given string by removing all stopwords in the specified language.
Parameters: - str: the string to be cleared. - language: the language of the stopwords to be removed in ISO 639-1 format.
Return: - string: the cleared string.
func (*StopwordsMapping) IsStopword ¶ added in v0.1.4
func (m *StopwordsMapping) IsStopword(word string, language ISOCode639_1) bool
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.