0.08
No commit activity in last 3 years
No release in over 3 years
Port of PHP function similar_text to Ruby as a native extension. Adds methods similar and similar_chars to core String class.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

Ruby similar_text

Calculate the similarity between two strings. Port of PHP similar_text function to Ruby, built as a native extension.

Description from php.net:

This calculates the similarity between two strings as described in Oliver [1993]. Note that this implementation does not use a stack as in Oliver's pseudo code, but recursive calls which may or may not speed up the whole process. Note also that the complexity of this algorithm is O(N**3) where N is the length of the longest string.

INSTALL

You can install this extension via gems:

    $ sudo gem install similar_text

USAGE

Load extension:

require 'similar_text'

And use it by calling one of two methods (similar or similar_chars):

"Hello, World!".similar("Hello World!") #=> 96.0
"Hello, World!".similar_chars("Hello World!") #=> 12

LICENSE

BSD simplified license.