Class: EncoderTools::CLI::Subtitles::SpellCheck

Inherits:
Base
  • Object
show all
Defined in:
lib/encoder-tools/cli/subtitles/spell_check.rb

Constant Summary collapse

DEFAULT_DICT =
'/usr/share/dict/words'.freeze

Instance Attribute Summary

Attributes inherited from Base

#options, #shell

Instance Method Summary collapse

Methods inherited from Base

#parse, #parser, parser, #read, #write

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from EncoderTools::CLI::Base

Instance Method Details

#runObject



9
10
11
12
13
14
15
# File 'lib/encoder-tools/cli/subtitles/spell_check.rb', line 9

def run
  write(read.each do |subtitle|
    subtitle.text.gsub!(/\w+/) do |word|
      fix_word(word)
    end
  end)
end