Browse files

updated readme and bumped up version

  • Loading branch information...
1 parent 220f2ae commit 7e87ef660640e507c8045100276007a0f438c07c @tarunc tarunc committed Sep 29, 2013
Showing with 31 additions and 34 deletions.
  1. +28 −28 README.md
  2. +3 −6 package.json
View
56 README.md
@@ -15,20 +15,20 @@ Check it out [http://joshaven.com/string_score](http://joshaven.com/string_score
## Installation Notes
Simply include one of the string score JavaScript files and call the .score() method on any string.
-## Installation Notes
- npm install string_score
+### NodeJS Installation
+ npm install --save string_score
-## Usage
+In your NodeJS file, just do:
require("string_score");
Thats it! It will automatically add a .score() method to all JavaScript String object... "String".score("str");
-# Examples
+# Examples
(results are for example only... I may change the scoring algorithm without updating examples)
-
+
"hello world".score("axl") //=> 0
"hello world".score("ow") //=> 0.35454545454545455
-
+
"hello world".score("e") //=>0.1090909090909091 (single letter match)
"hello world".score("h") //=>0.5363636363636364 (single letter match plus bonuses for beginning of word and beginning of phrase)
"hello world".score("he") //=>0.5727272727272728
@@ -38,7 +38,7 @@ Thats it! It will automatically add a .score() method to all JavaScript String o
...
"hello world".score("hello worl") //=>0.8636363636363635
"hello world".score("hello world") //=> 1
-
+
// And then there is fuzziness
"hello world".score("hello wor1") //=>0 (the "1" in place of the "l" makes a mismatch)
"hello world".score("hello wor1",0.5) //=>0.6081818181818182 (fuzzy)
@@ -65,16 +65,16 @@ Fully functional in the 100% of the tested browsers:
* Chrome: 2 & Newer (Windows)
* Opera: 9.64 & Newer (Windows)
-** IE 7 fails (stop running this script message) with 4000 iterations
-of the benchmark test. All other browsers tested survived this test,
-and in fact survive a larger number of iterations. The benchmark
-that is causing IE to choke is: 4000 iterations of 446 character
+** IE 7 fails (stop running this script message) with 4000 iterations
+of the benchmark test. All other browsers tested survived this test,
+and in fact survive a larger number of iterations. The benchmark
+that is causing IE to choke is: 4000 iterations of 446 character
string scoring a 70 character match.
# Benchmarks
-This is the fastest and smallest javascript string scoring plugin
-that I am aware of. I have taken great joy in squeezing every
-millisecond I can out of this script. If you are aware of any
+This is the fastest and smallest javascript string scoring plugin
+that I am aware of. I have taken great joy in squeezing every
+millisecond I can out of this script. If you are aware of any
ways to improve this script, please let me know.
string_score.js is faster and smaller and does more than either liquidmetal.js or quicksilver.js
@@ -89,7 +89,7 @@ The test: 4000 iterations of 446 character string scoring a 70-character match
* liquidmetal.js:
* Firefox 3.6 (1578ms)
* Firefox 4 (853ms)
- * Chrome 9 (339ms)
+ * Chrome 9 (339ms)
* Safari 5 (996ms)
* quicksilver.js:
* Firefox 3.6 (3300ms)
@@ -100,45 +100,45 @@ The test: 4000 iterations of 446 character string scoring a 70-character match
* Firefox 4 (OUCH! I am not sure it heats up my laptop and asks if I want to stop the script... fuzzy_string, nice idea but it doesn't like large strings matches.)
** Tests run with jQuery 1.5 on Mac Book Pro 2.4GHz Core 2 Duo running Snow Leopard
-*** quicksilver & string_score both use the same test file because they are used in the
+*** quicksilver & string_score both use the same test file because they are used in the
same way, LiquidMetal has to be called differently so the test file was modified to work
with the LiquidMetal Syntax.
# Ports
-Please notify me of any ports so I can have them listed here.
+Please notify me of any ports so I can have them listed here.
Please also keep track of the string score version that you have ported from. For example, in your readme include a note like: ported from version 0.2
-* C# port: [ScoreSharp Bruno Lara Tavares](https://github.com/bltavares/scoresharp)
+* C# port: [ScoreSharp Bruno Lara Tavares](https://github.com/bltavares/scoresharp)
* C port: [string_score by kurige](https://github.com/kurige/string_score)
* Python port: [stringslipper by Yesudeep Mangalapilly](https://github.com/gorakhargosh/stringslipper)
-* Ruby ports:
+* Ruby ports:
* [scorer by Matt Duncan](https://github.com/mrduncan/scorer)
* [string_score_ruby by James Lindley](https://github.com/jlindley/string_score_ruby)
* Java: [string_score by Shingo Omura](https://github.com/everpeace/string-score)
* 4GL: [string_score by Antonio Pérez](https://github.com/skarcha/string_score)
* Objective-C [StringScore by Nicholas Bruning](https://github.com/thetron/StringScore)
# Notes
-string_score.js does not have any external dependencies
+string_score.js does not have any external dependencies
other than a reasonably new browser.
-The tests located in the tests folder rely on the files
+The tests located in the tests folder rely on the files
located in the tests folder.
-Please share your testing results with me if you are
+Please share your testing results with me if you are
able to test under an unlisted browser.
# Credits
-Author [Joshaven Potter](mailto:yourtech@gmail.com)
+Author [Joshaven Potter](mailto:yourtech@gmail.com)
-Thank you Lachie Cox and Quicksilver for inspiration.
+Thank you Lachie Cox and Quicksilver for inspiration.
Special thanks to all who contribute... and if you're not listed here please email me.
##Contributors
-[Yesudeep Mangalapilly](mailto:yesudeep@gmail.com) - Collaborator
-Eric Celeste
-[Matt Duncan](https://github.com/mrduncan)
-[Bruno Lara Tavares](https://github.com/bltavares)
+[Yesudeep Mangalapilly](mailto:yesudeep@gmail.com) - Collaborator
+Eric Celeste
+[Matt Duncan](https://github.com/mrduncan)
+[Bruno Lara Tavares](https://github.com/bltavares)
# License
Licensed under the [MIT license](http://www.opensource.org/licenses/mit-license.php).
View
9 package.json
@@ -1,14 +1,11 @@
{
"name": "string_score",
- "version": "0.1.10",
+ "version": "0.1.20",
"description": "String Scoring Algorithm packaged for NodeJS",
"keywords": ["string", "score", "string_score"],
"author": "Joshaven Potter <yourtech@gmail.com>",
- "repository": { "type": "git", "url": "git://github.com/tarunc/string_score.git" },
+ "repository": { "type": "git", "url": "git://github.com/joshaven/string_score.git" },
"dependencies": {},
- "devDependencies": {
- "mocha": "*",
- "should": "*"
- },
+ "devDependencies": {},
"main": "string_score.js"
}

0 comments on commit 7e87ef6

Please sign in to comment.