module ActsAsTokenizable::ClassMethods
Attributes
token_field_name[RW]
Public Instance Methods
acts_as_tokenizable(field_name = :token)
click to toggle source
# File lib/acts_as_tokenizable/acts_as_tokenizable.rb, line 9 def acts_as_tokenizable(field_name = :token) include InstanceMethods include TokenizedBy before_save :tokenize self.token_field_name = field_name end
prepare_search_token(search_token)
click to toggle source
search_token parameter is used by tokenized_by. This function allows for preparation before tokenized_by function is invoked. Usually this means removing stop words, replacing words. By default it tokenizes each word and removes duplicates.
# File lib/acts_as_tokenizable/acts_as_tokenizable.rb, line 22 def prepare_search_token(search_token) StringUtils.words_to_token(search_token) end