Sha256: 42fbfefe161e16c06fc27e543e6c70be4941365e77ef0d68811a153c8afbd374

Contents?: true

Size: 1.11 KB

Versions: 14

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

module LittleWeasel
  module Preprocessors
    # This class represents a word that has passed through
    # Preprocessor::WordPreprocessor processing. Word preprocessors
    # are used to preprocess a word before it is passed to any
    # Filters::WordFilters, and before it is compared against the
    # dictionary for validity.
    # :reek:Attribute, ignored - Fixing this would result in nothing but trivial setter methods
    class PreprocessedWord
      attr_accessor :original_word, :preprocessed, :preprocessed_word, :preprocessor, :preprocessor_order

      def initialize(original_word:, preprocessed:, preprocessed_word:, preprocessor:, preprocessor_order:)
        self.original_word = original_word
        self.preprocessed_word = preprocessed_word
        self.preprocessed = preprocessed
        self.preprocessor = preprocessor
        self.preprocessor_order = preprocessor_order
      end

      # Returns true if the word was preprocessed; false, if the word
      # was not preprocessed by this preprocessor.
      def preprocessed?
        preprocessed
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
LittleWeasel-5.0.13 lib/LittleWeasel/preprocessors/preprocessed_word.rb
LittleWeasel-5.0.12 lib/LittleWeasel/preprocessors/preprocessed_word.rb
LittleWeasel-5.0.11 lib/LittleWeasel/preprocessors/preprocessed_word.rb
LittleWeasel-5.0.10 lib/LittleWeasel/preprocessors/preprocessed_word.rb
LittleWeasel-5.0.9 lib/LittleWeasel/preprocessors/preprocessed_word.rb
LittleWeasel-5.0.8 lib/LittleWeasel/preprocessors/preprocessed_word.rb
LittleWeasel-5.0.7 lib/LittleWeasel/preprocessors/preprocessed_word.rb
LittleWeasel-5.0.6 lib/LittleWeasel/preprocessors/preprocessed_word.rb
LittleWeasel-5.0.5 lib/LittleWeasel/preprocessors/preprocessed_word.rb
LittleWeasel-5.0.4 lib/LittleWeasel/preprocessors/preprocessed_word.rb
LittleWeasel-5.0.3 lib/LittleWeasel/preprocessors/preprocessed_word.rb
LittleWeasel-5.0.2 lib/LittleWeasel/preprocessors/preprocessed_word.rb
LittleWeasel-5.0.1 lib/LittleWeasel/preprocessors/preprocessed_word.rb
LittleWeasel-5.0.0 lib/LittleWeasel/preprocessors/preprocessed_word.rb