Module: English::Dresner

Extended by:
Dresner
Included in:
Dresner
Defined in:
lib/gems/english-0.3.1/lib/english/dresner.rb

Instance Method Summary collapse

Instance Method Details

#dresner(string) ⇒ Object

Scramble the inner characters of words leaving the text still readable (research at Cambridge University, code by KurtDresner).

For example, the above text may result in:

Srblamce the iennr cchrteaars of wodrs lvenaig the txet stlil rbeaadle
(rreceash at Cbamigdre Uverintisy, cdoe by KrneruestDr?)


17
18
19
# File 'lib/gems/english-0.3.1/lib/english/dresner.rb', line 17

def dresner(string)
  string.gsub(/\B\w+\B/){$&.split(//).sort_by{rand}}
end