04/03
2015
Wallogit.com
2017 © Pedro Peláez
LiquidMetal is a PHP port of liquidmetal.js, a Quicksilver-inspiried scoring algorithm.
This is a PHP port of rmm5t/liquidmetal:, (*1)
“A mimetic poly-alloy of the Quicksilver scoring algorithm, essentially
LiquidMetal. </Schwarzenegger Voice>”, (*2)
If not using Composer's autoloader, include the library:, (*3)
include 'LiquidMetal.php';
Score any string against an abbreviation:, (*4)
LiquidMetal::score("FooBar", "foo"); //=> 0.950
LiquidMetal::score("FooBar", "fb"); //=> 0.917
LiquidMetal::score("Foo Bar", "fb"); //=> 0.929
LiquidMetal::score("Foo Bar", "baz"); //=> 0.0
LiquidMetal::score("Foo Bar", ""); //=> 0.8
All scores fall between a range of 0.0 (no match) to 1.0 (perfect match)., (*5)