Method: String#each_typo

Defined in:
lib/ronin/support/text/typo/core_ext/string.rb

#each_typo(**kwargs) {|typoed| ... } ⇒ Enumerator

Enumerates over every typo mistake for the String.

Examples:

"consciousness".each_typo do |typo|
  # ...
end

Parameters:

  • kwargs (Hash{Symbol => Boolean})

    Additional keyword arguments.

Options Hash (**kwargs):

  • omit (Boolean)

    Enables/disables omission of repeated characters.

  • repeat (Boolean)

    Enables/disables repeatition of single characters.

  • swap (Boolean)

    Enables/disables swapping of certain common character pairs.

  • suffix (Boolean)

    Enables/disables changing the suffixes of words.

Yields:

  • (typoed)

    If a block is given, it will be passed each possible typo of the original String.

Yield Parameters:

  • A (String)

    modified version of the original String.

Returns:

  • (Enumerator)

    If no block is given, an Enumerator will be returned.

See Also:

Since:

  • 1.0.0



97
98
99
# File 'lib/ronin/support/text/typo/core_ext/string.rb', line 97

def each_typo(**kwargs,&block)
  Ronin::Support::Text::Typo.each_substitution(self,**kwargs,&block)
end