<commit_before>require 'cucumber/formatter/pretty'

module Cucumber
  module Cli
    class LanguageHelpFormatter < Formatter::Pretty
      INCOMPLETE = %{
The Cucumber grammar has evolved since this translation was written.
Please help us complete the translation by translating the missing words in

#{Cucumber::LANGUAGE_FILE}

Then contribute back to the Cucumber project. Details here:
http://wiki.github.com/aslakhellesoy/cucumber/spoken-languages
}

      def self.list_languages(io)
        raw = Cucumber::LANGUAGES.keys.sort.map do |lang|
          [lang, Cucumber::LANGUAGES[lang]['name'], Cucumber::LANGUAGES[lang]['native']]
        end
        table = Ast::Table.new(raw)
        new(nil, io, {:check_lang=>true}, '').visit_multiline_arg(table, :passed)
      end

      def self.list_keywords(io, lang)
        raw = Cucumber::KEYWORD_KEYS.map do |key|
          [key, Cucumber::LANGUAGES[lang][key]]
        end
        table = Ast::Table.new(raw)
        new(nil, io, {:incomplete => Cucumber.language_incomplete?(lang)}, '').visit_multiline_arg(table, :passed)
      end

      def visit_multiline_arg(table, status)
        if @options[:incomplete]
          @io.puts(format_string(INCOMPLETE, :failed))
        end
        super
      end

      def visit_table_row(table_row, status)
        @col = 1
        super
      end

      def visit_table_cell_value(value, width, status)
        if @col == 1
          if(@options[:check_lang])
            @incomplete = Cucumber.language_incomplete?(value)
          end
          status = :comment 
        elsif @incomplete
          status = :failed
        end
        
        @col += 1
        super(value, width, status)
      end
    end
  end
end<commit_msg>Use yellow to help color blind people<commit_after>require 'cucumber/formatter/pretty'

module Cucumber
  module Cli
    class LanguageHelpFormatter < Formatter::Pretty
      INCOMPLETE = %{
The Cucumber grammar has evolved since this translation was written.
Please help us complete the translation by translating the missing words in

#{Cucumber::LANGUAGE_FILE}

Then contribute back to the Cucumber project. Details here:
http://wiki.github.com/aslakhellesoy/cucumber/spoken-languages
}

      def self.list_languages(io)
        raw = Cucumber::LANGUAGES.keys.sort.map do |lang|
          [lang, Cucumber::LANGUAGES[lang]['name'], Cucumber::LANGUAGES[lang]['native']]
        end
        table = Ast::Table.new(raw)
        new(nil, io, {:check_lang=>true}, '').visit_multiline_arg(table, :passed)
      end

      def self.list_keywords(io, lang)
        raw = Cucumber::KEYWORD_KEYS.map do |key|
          [key, Cucumber::LANGUAGES[lang][key]]
        end
        table = Ast::Table.new(raw)
        new(nil, io, {:incomplete => Cucumber.language_incomplete?(lang)}, '').visit_multiline_arg(table, :passed)
      end

      def visit_multiline_arg(table, status)
        if @options[:incomplete]
          @io.puts(format_string(INCOMPLETE, :failed))
        end
        super
      end

      def visit_table_row(table_row, status)
        @col = 1
        super
      end

      def visit_table_cell_value(value, width, status)
        if @col == 1
          if(@options[:check_lang])
            @incomplete = Cucumber.language_incomplete?(value)
          end
          status = :comment 
        elsif @incomplete
          status = :undefined
        end
        
        @col += 1
        super(value, width, status)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10438772583882994, 'fraction_numerical': 0.0017206767995411529, 'mean_word_length': 2.5701125895598773, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1358604', 'n_tokens_mistral': 1113, 'n_tokens_neox': 1064, 'n_words': 253}