Module: English::Dresner
Instance Method Summary collapse
-
#dresner(string) ⇒ Object
Scramble the inner characters of words leaving the text still readable (research at Cambridge University, code by KurtDresner).
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 |