Project

wordplay

0.0
No commit activity in last 3 years
No release in over 3 years
Some interesting methods to use on words.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 3.2.0, ~> 3.2
 Project Readme

Wordplay

Gem Release Version Build Status

Some interesting methods to use on words.

The idea came from a story about a boy, who, when asked to put words in alphabetical order, ordered the letters of the word instead of the words themselves. I was intrigued by "fox" which was already sorted in that manner.

Example:

require "wordplay"

word = Wordplay.new("fox")
word.ordered_letters? # true

word = Wordplay.new("pizza")
word.reverse_ordered_letters # zzpia

There is also an example which loops through /usr/share/dict/words to find words with their letters sorted. I think my favorite is "bijoux".

New in Version 0.0.2

Match palindromes!

require "wordplay"

words = Wordplay.new("Do geese see God?") # ignores spaces and punctuation
words.palindrome? # true

Contributing

If you have an interesting word method or a bugfix, please submit a pull request.

Contact

@boonedocks on Twitter