Class: Zxcvbn::Match

Inherits:
Data
  • Object
show all
Defined in:
lib/zxcvbn/match.rb,
sig/zxcvbn/match.rbs

Overview

A substring match found by one of the pattern matchers.

All attributes are optional and default to nil. Use #with to derive a new match with changed attributes.

Constant Summary

Constants inherited from Data

Data::RESERVED_NAMES

Instance Attribute Summary collapse

Attributes inherited from Data

#adjacency_graphs, #dictionaries, #graph_stats

Instance Method Summary collapse

Methods inherited from Data

#add_word_list, #build_tries, #compute_graph_stats, #dictionary_tries, #ranked_dictionaries, #read_word_list

Constructor Details

#initialize(pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil) ⇒ Match

Returns a new instance of Match.

Parameters:

  • pattern: (String, nil) (defaults to: nil)
  • i: (Integer, nil) (defaults to: nil)
  • j: (Integer, nil) (defaults to: nil)
  • token: (String, nil) (defaults to: nil)
  • matched_word: (String, nil) (defaults to: nil)
  • rank: (Integer, nil) (defaults to: nil)
  • dictionary_name: (String, nil) (defaults to: nil)
  • reversed: (Boolean, nil) (defaults to: nil)
  • l33t: (Boolean, nil) (defaults to: nil)
  • sub: (Hash[String, String], nil) (defaults to: nil)
  • sub_display: (String, nil) (defaults to: nil)
  • guesses: (Numeric, nil) (defaults to: nil)
  • guesses_log10: (Float, nil) (defaults to: nil)
  • base_guesses: (Numeric, nil) (defaults to: nil)
  • uppercase_variations: (Numeric, nil) (defaults to: nil)
  • l33t_variations: (Numeric, nil) (defaults to: nil)
  • base_token: (String, nil) (defaults to: nil)
  • repeat_count: (Integer, nil) (defaults to: nil)
  • sequence_name: (String, nil) (defaults to: nil)
  • sequence_space: (Integer, nil) (defaults to: nil)
  • ascending: (Boolean, nil) (defaults to: nil)
  • graph: (String, nil) (defaults to: nil)
  • turns: (Integer, nil) (defaults to: nil)
  • shifted_count: (Integer, nil) (defaults to: nil)
  • year: (Integer, nil) (defaults to: nil)
  • month: (Integer, nil) (defaults to: nil)
  • day: (Integer, nil) (defaults to: nil)
  • separator: (String, nil) (defaults to: nil)


73
74
75
76
77
78
79
80
81
82
83
# File 'lib/zxcvbn/match.rb', line 73

def initialize(
  pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
  dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
  sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
  uppercase_variations: nil, l33t_variations: nil, base_token: nil,
  repeat_count: nil, sequence_name: nil, sequence_space: nil,
  ascending: nil, graph: nil, turns: nil, shifted_count: nil,
  year: nil, month: nil, day: nil, separator: nil
)
  super
end

Instance Attribute Details

#ascendingBoolean? (readonly)

Returns true if the sequence is ascending.

Returns:

  • (Boolean, nil)

    true if the sequence is ascending



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#base_guessesNumeric? (readonly)

Returns guesses for the base token (repeat matches) or rank before variation multipliers (dictionary matches).

Returns:

  • (Numeric, nil)

    guesses for the base token (repeat matches) or rank before variation multipliers (dictionary matches)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#base_tokenString? (readonly)

Returns the minimal repeating unit (repeat matches).

Returns:

  • (String, nil)

    the minimal repeating unit (repeat matches)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#dayInteger? (readonly)

Returns matched day (date matches).

Returns:

  • (Integer, nil)

    matched day (date matches)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#dictionary_nameString? (readonly)

Returns source dictionary name (dictionary matches).

Returns:

  • (String, nil)

    source dictionary name (dictionary matches)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#graphString? (readonly)

Returns keyboard graph name (spatial matches).

Returns:

  • (String, nil)

    keyboard graph name (spatial matches)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#guessesNumeric? (readonly)

Returns estimated guess count.

Returns:

  • (Numeric, nil)

    estimated guess count



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#guesses_log10Float? (readonly)

Returns log10 of #guesses.

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#iInteger? (readonly)

Returns start index in the password (inclusive).

Returns:

  • (Integer, nil)

    start index in the password (inclusive)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#jInteger? (readonly)

Returns end index in the password (inclusive).

Returns:

  • (Integer, nil)

    end index in the password (inclusive)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#l33tBoolean? (readonly)

Returns true when the match required l33t substitution.

Returns:

  • (Boolean, nil)

    true when the match required l33t substitution



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#l33t_variationsNumeric? (readonly)

Returns l33t substitution variant count (dictionary matches).

Returns:

  • (Numeric, nil)

    l33t substitution variant count (dictionary matches)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#matched_wordString? (readonly)

Returns lowercased dictionary word (dictionary matches).

Returns:

  • (String, nil)

    lowercased dictionary word (dictionary matches)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#monthInteger? (readonly)

Returns matched month (date matches).

Returns:

  • (Integer, nil)

    matched month (date matches)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#patternString? (readonly)

Returns the matcher that produced this match.

Returns:

  • (String, nil)

    the matcher that produced this match



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#rankInteger? (readonly)

Returns frequency rank of the matched word (dictionary matches).

Returns:

  • (Integer, nil)

    frequency rank of the matched word (dictionary matches)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#repeat_countInteger? (readonly)

Returns number of repetitions (repeat matches).

Returns:

  • (Integer, nil)

    number of repetitions (repeat matches)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#reversedBoolean? (readonly)

Returns true when matched in the reversed password.

Returns:

  • (Boolean, nil)

    true when matched in the reversed password



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#separatorString? (readonly)

Returns date separator character (date matches).

Returns:

  • (String, nil)

    date separator character (date matches)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#sequence_nameString? (readonly)

Returns sequence type: "lower", "upper", "digits", or "unicode".

Returns:

  • (String, nil)

    sequence type: "lower", "upper", "digits", or "unicode"



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#sequence_spaceInteger? (readonly)

Returns size of the character set for the sequence.

Returns:

  • (Integer, nil)

    size of the character set for the sequence



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#shifted_countInteger? (readonly)

Returns number of shifted characters (spatial matches).

Returns:

  • (Integer, nil)

    number of shifted characters (spatial matches)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#subHash? (readonly)

Returns map of l33t characters to their substituted letters.

Returns:

  • (Hash, nil)

    map of l33t characters to their substituted letters



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#sub_displayString? (readonly)

Returns human-readable substitution summary.

Returns:

  • (String, nil)

    human-readable substitution summary



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#tokenString? (readonly)

Returns the matched substring.

Returns:

  • (String, nil)

    the matched substring



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#turnsInteger? (readonly)

Returns number of direction changes (spatial matches).

Returns:

  • (Integer, nil)

    number of direction changes (spatial matches)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#uppercase_variationsNumeric? (readonly)

Returns capitalisation variant count (dictionary matches).

Returns:

  • (Numeric, nil)

    capitalisation variant count (dictionary matches)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

#yearInteger? (readonly)

Returns matched year (date/year matches).

Returns:

  • (Integer, nil)

    matched year (date/year matches)



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/zxcvbn/match.rb', line 66

Match = ::Data.define(
  :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed,
  :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses,
  :uppercase_variations, :l33t_variations, :base_token, :repeat_count,
  :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count,
  :year, :month, :day, :separator
) do
  def initialize(
    pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil,
    dictionary_name: nil, reversed: nil, l33t: nil, sub: nil,
    sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil,
    uppercase_variations: nil, l33t_variations: nil, base_token: nil,
    repeat_count: nil, sequence_name: nil, sequence_space: nil,
    ascending: nil, graph: nil, turns: nil, shifted_count: nil,
    year: nil, month: nil, day: nil, separator: nil
  )
    super
  end

  # @return [String] a human-readable representation omitting nil fields and token
  def inspect
    fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
    "#<data #{self.class} #{fields}>"
  end

  # @param pp [PP] the pretty-printer instance
  # @return [void]
  def pretty_print(pp)
    fields = to_h.reject { |_, v| v.nil? }
    pp.group(1, "#<data #{self.class}", '>') do
      fields.each_with_index do |(k, v), i|
        pp.text(',') if i.positive?
        pp.breakable ' '
        pp.text("#{k}=")
        v.pretty_print(pp)
      end
    end
  end
end

Instance Method Details

#inspectString

Returns a human-readable representation omitting nil fields and token.

Returns:

  • (String)

    a human-readable representation omitting nil fields and token



86
87
88
89
# File 'lib/zxcvbn/match.rb', line 86

def inspect
  fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
  "#<data #{self.class} #{fields}>"
end

#pretty_print(pp) ⇒ void

This method returns an undefined value.

Parameters:

  • pp (PP)

    the pretty-printer instance



93
94
95
96
97
98
99
100
101
102
103
# File 'lib/zxcvbn/match.rb', line 93

def pretty_print(pp)
  fields = to_h.reject { |_, v| v.nil? }
  pp.group(1, "#<data #{self.class}", '>') do
    fields.each_with_index do |(k, v), i|
      pp.text(',') if i.positive?
      pp.breakable ' '
      pp.text("#{k}=")
      v.pretty_print(pp)
    end
  end
end

#withMatch

Parameters:

  • (Object)

Returns:



34
# File 'sig/zxcvbn/match.rbs', line 34

def with: (**untyped) -> Match