Class: CharDet::EscCharSetProber

### Home Classes Methods

### In Files

- lib/tmail/vendor/rchardet-1.3/lib/rchardet/escprober.rb

### Parent

CharDet::CharSetProber

### Methods

- ::new
- #feed
- #get_charset_name
- #get_confidence
- #reset

### Files

- CHANGES
- LICENSE
- NOTES
- README
- Rakefile
- MANIFEST
- Makefile
- depend
- Makefile
- COPYING
- README

### Class/Module Index

Quicksearch

- TMail
- TMail::Address
- TMail::AddressGroup
- TMail::AddressHeader
- TMail::Attachment
- TMail::ContentDispositionHeader
- TMail::ContentTransferEncodingHeader
- TMail::ContentTypeHeader
- TMail::DateTimeHeader
- TMail::EncryptedHeader
- TMail::FilePort
- TMail::HeaderField
- TMail::KeywordsHeader
- TMail::Mail
- TMail::MailFlags
- TMail::Maildir
- TMail::MaildirLoader
- TMail::MaildirPort
- TMail::MboxLoader
- TMail::MessageIdHeader
- TMail::MhLoader
- TMail::MhMailbox
- TMail::MhPort
- TMail::MimeVersionHeader
- TMail::Parser
- TMail::Port
- TMail::ReceivedHeader
- TMail::ReferencesHeader
- TMail::ReturnPathHeader
- TMail::SingleAddressHeader
- TMail::StringPort
- TMail::StructuredHeader
- TMail::SyntaxError
- TMail::TMailScanner
- TMail::TextUtils
- TMail::UNIXMbox
- TMail::UnstructuredHeader
- CharDet
- CharDet::Big5DistributionAnalysis
- CharDet::Big5Prober
- CharDet::CharDistributionAnalysis
- CharDet::CharSetGroupProber
- CharDet::CharSetProber
- CharDet::CodingStateMachine
- CharDet::EUCJPContextAnalysis
- CharDet::EUCJPDistributionAnalysis
- CharDet::EUCJPProber
- CharDet::EUCKRDistributionAnalysis
- CharDet::EUCKRProber
- CharDet::EUCTWDistributionAnalysis
- CharDet::EUCTWProber
- CharDet::EscCharSetProber
- CharDet::GB2312DistributionAnalysis
- CharDet::GB2312Prober
- CharDet::HebrewProber
- CharDet::JapaneseContextAnalysis
- CharDet::Latin1Prober
- CharDet::MBCSGroupProber
- CharDet::MultiByteCharSetProber
- CharDet::SBCSGroupProber
- CharDet::SJISContextAnalysis
- CharDet::SJISDistributionAnalysis
- CharDet::SJISProber
- CharDet::SingleByteCharSetProber
- CharDet::UTF8Prober
- CharDet::UniversalDetector

No matching classes.

# CharDet::EscCharSetProber

### Public Class Methods

new() click to toggle source

    # File lib/tmail/vendor/rchardet-1.3/lib/rchardet/escprober.rb, line 31
    def initialize
      super()
      @_mCodingSM = [ CodingStateMachine.new(HZSMModel),
                      CodingStateMachine.new(ISO2022CNSMModel),
                      CodingStateMachine.new(ISO2022JPSMModel),
                      CodingStateMachine.new(ISO2022KRSMModel)  ]
      reset()
    end

### Public Instance Methods

feed(aBuf) click to toggle source

    # File lib/tmail/vendor/rchardet-1.3/lib/rchardet/escprober.rb, line 63
    def feed(aBuf)
      aBuf.each_byte do |b|
        c = b.chr
        for codingSM in @_mCodingSM
          next unless codingSM
          next unless codingSM.active
          codingState = codingSM.next_state(c)
          if codingState == EError
            codingSM.active = false
            @_mActiveSM -= 1
            if @_mActiveSM <= 0
              @_mState = ENotMe
              return get_state()
            end
          elsif codingState == EItsMe
            @_mState = EFoundIt
            @_mDetectedCharset = codingSM.get_coding_state_machine()
            return get_state()
          end
        end
      end
      return get_state()

    end

get_charset_name() click to toggle source

    # File lib/tmail/vendor/rchardet-1.3/lib/rchardet/escprober.rb, line 51
    def get_charset_name
      return @_mDetectedCharset
    end

get_confidence() click to toggle source

    # File lib/tmail/vendor/rchardet-1.3/lib/rchardet/escprober.rb, line 55
    def get_confidence
      if @_mDetectedCharset
        return 0.99
      else
        return 0.00
      end
    end

reset() click to toggle source

    # File lib/tmail/vendor/rchardet-1.3/lib/rchardet/escprober.rb, line 40
    def reset
      super()
      for codingSM in @_mCodingSM
        next if not codingSM
        codingSM.active = true
        codingSM.reset()
      end
      @_mActiveSM = @_mCodingSM.length
      @_mDetectedCharset = nil
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.