Class Ferret::Analysis::AsciiStandardAnalyzer
In: ext/r_analysis.c
Parent: Ferret::Analysis::Analyzer

Summary

The AsciiStandardAnalyzer is the most advanced of the available ascii-analyzers. If it were implemented in Ruby it would look like this;

  class AsciiStandardAnalyzer
    def initialize(stop_words = FULL_ENGLISH_STOP_WORDS, lower = true)
      @lower = lower
      @stop_words = stop_words
    end

    def token_stream(field, str)
      ts = AsciiStandardTokenizer.new(str)
      ts = AsciiLowerCaseFilter.new(ts) if @lower
      ts = StopFilter.new(ts, @stop_words)
      ts = HyphenFilter.new(ts)
    end
  end

As you can see it makes use of the AsciiStandardTokenizer and you can also add your own list of stop-words if you wish. Note that this tokenizer won‘t recognize non-ascii characters so you should use the StandardAnalyzer is you want to analyze multi-byte data like "UTF-8".

Methods

new  

Public Class methods

Create a new AsciiStandardAnalyzer which downcases tokens by default but can optionally leave case as is. Lowercasing will be done based on the current locale. You can also set the list of stop-words to be used by the StopFilter.

lower:set to false if you don‘t want the field‘s tokens to be downcased
stop_words:list of stop-words to pass to the StopFilter

[Validate]