UNPKG

motion

Version:

motion - moving development forward

56 lines (55 loc) 7.97 kB
{ "_args": [ [ "sb-string_score@https://registry.npmjs.org/sb-string_score/-/sb-string_score-0.1.20.tgz", "/Users/nw/flint/packages/flint" ] ], "_from": "sb-string_score@>=0.1.20 <0.2.0", "_id": "sb-string_score@0.1.20", "_inCache": true, "_location": "/sb-string_score", "_phantomChildren": {}, "_requested": { "name": "sb-string_score", "raw": "sb-string_score@https://registry.npmjs.org/sb-string_score/-/sb-string_score-0.1.20.tgz", "rawSpec": "https://registry.npmjs.org/sb-string_score/-/sb-string_score-0.1.20.tgz", "scope": null, "spec": "https://registry.npmjs.org/sb-string_score/-/sb-string_score-0.1.20.tgz", "type": "remote" }, "_requiredBy": [ "/" ], "_resolved": "https://registry.npmjs.org/sb-string_score/-/sb-string_score-0.1.20.tgz", "_shasum": "f33a4fdd0c5d3bb44a5e35b6d59e3370efcd1fe4", "_shrinkwrap": null, "_spec": "sb-string_score@https://registry.npmjs.org/sb-string_score/-/sb-string_score-0.1.20.tgz", "_where": "/Users/nw/flint/packages/flint", "author": { "email": "yourtech@gmail.com", "name": "Joshaven Potter" }, "bugs": { "url": "https://github.com/joshaven/string_score/issues" }, "dependencies": {}, "description": "My string_score fork that exports instead of modifying proto", "devDependencies": {}, "homepage": "https://github.com/joshaven/string_score#readme", "keywords": [ "score", "string", "string_score" ], "main": "string_score.js", "name": "sb-string_score", "optionalDependencies": {}, "readme": "# What is it\n\n* Free - MIT License\n* Simple - Adds a .score() method to the JavaScript String object... \"String\".score(\"str\");\n* Fast - fastest that I can find, often drastically faster... run the tests yourself\n* Small - We are talking (520 Bytes)\n* Portable - Works in 100% of the browsers I've tested on multiple platforms\n* Independent - Doesn't require any other JavaScript - should work with any framework.\n* Tested - Not everyone writes tests (silly people). Testing using Qunit\n* Proper - Passes jslint as well as meets the coding practices and principles of opinionated developers :-)\n* Fuzzyable - Optional parameter for fuzziness (allows mismatched info to still score the string)\n\n# See it in action\nCheck it out [http://joshaven.com/string_score](http://joshaven.com/string_score)\n\n## Installation Notes\nSimply include one of the string score JavaScript files and call the .score() method on any string.\n\n### NodeJS Installation\n npm install --save string_score\n require(\"string_score\");\n\nThats it! It will automatically add a .score() method to all JavaScript String object... \"String\".score(\"str\");\n\n# Examples\n(results are for example only... I may change the scoring algorithm without updating examples)\n\n \"hello world\".score(\"axl\") //=> 0\n \"hello world\".score(\"ow\") //=> 0.35454545454545455\n\n // Single letter match\n \"hello world\".score(\"e\") //=>0.1090909090909091\n\n // Single letter match plus bonuses for beginning of word and beginning of phrase\n \"hello world\".score(\"h\") //=>0.5363636363636364\n\n \"hello world\".score(\"he\") //=>0.5727272727272728\n \"hello world\".score(\"hel\") //=>0.6090909090909091\n \"hello world\".score(\"hell\") //=>0.6454545454545455\n \"hello world\".score(\"hello\") //=>0.6818181818181818\n /* ... */\n \"hello world\".score(\"hello worl\") //=>0.8636363636363635\n \"hello world\".score(\"hello world\") //=> 1\n\n\n // Using a \"1\" in place of an \"l\" is a mismatch unless the score is fuzzy\n \"hello world\".score(\"hello wor1\") //=>0\n \"hello world\".score(\"hello wor1\",0.5) //=>0.6081818181818182 (fuzzy)\n\n // Finding a match in a shorter string is more significant.\n 'Hello'.score('h') //=>0.52\n 'He'.score('h') //=>0.6249999999999999\n\n // Same case matches better than wrong case\n 'Hello'.score('h') //=>0.52\n 'Hello'.score('H') //=>0.5800000000000001\n\n // Acronyms are given a little more weight\n \"Hillsdale Michigan\".score(\"HiMi\") > \"Hillsdale Michigan\".score(\"Hills\")\n \"Hillsdale Michigan\".score(\"HiMi\") < \"Hillsdale Michigan\".score(\"Hillsd\")\n\n# Tested And Operational Under all known environments (within reason)\n\nFully functional in the 100% of the tested browsers:\n\n* Firefox 3 & Newer (Mac & Windows)\n* Safari 4 & Newer (Mac & Windows)\n* IE: 7 & Newer (Windows) **\n* Chrome: 2 & Newer (Windows)\n* Opera: 9.64 & Newer (Windows)\n\n** IE 7 fails (stop running this script message) with 4000 iterations\nof the benchmark test. All other browsers tested survived this test,\nand in fact survive a larger number of iterations. The benchmark\nthat is causing IE to choke is: 4000 iterations of 446 character\nstring scoring a 70 character match.\n\n# Benchmarks\nThis is the fastest and smallest javascript string scoring script\nthat I am aware of. I have taken great joy in squeezing every\nmillisecond I can out of this script. If you are aware of any\nways to improve this script, please let me know.\n\nstring_score.js is faster and smaller and does more than any other scripts\nthat I am aware. Tests for liquidmetal.js or quicksilver.js are included in my\ntest suite for direct comparison.\n\nThe test: 4000 iterations of 446 character string scoring a 70-character match\n\n* string_score.js:\n * Firefox 3.6 (805ms)\n * Firefox 4 (245ms)\n * Chrome 9 (268ms)\n * Safari 5 (259ms)\n* liquidmetal.js:\n * Firefox 3.6 (1578ms)\n * Firefox 4 (853ms)\n * Chrome 9 (339ms)\n * Safari 5 (996ms)\n* quicksilver.js:\n * Firefox 3.6 (3300ms)\n * Firefox 4 (1994ms)\n * Chrome 9 (2835ms)\n * Safari 5 (3252ms)\n* fuzzy_string.js\n * Firefox 4 (OUCH! I am not sure it heats up my laptop and asks if I want to\n stop the script... fuzzy_string, nice idea but it doesn't like large strings\n matches.)\n\n** Tests run with jQuery 1.5 on Mac Book Pro 2.4GHz Core 2 Duo running Snow Leopard\n*** quicksilver & string_score both use the same test file because they are used in the\nsame way, LiquidMetal has to be called differently so the test file was modified to work\nwith the LiquidMetal Syntax.\n\n# Ports\nPlease notify me of any ports so I can have them listed here.\nPlease also keep track of the string score version that you have ported from. For\nexample, in your readme include a note like: ported from version 0.2\n\n* C# port: [ScoreSharp Bruno Lara Tavares](https://github.com/bltavares/scoresharp)\n* C port: [string_score by kurige](https://github.com/kurige/string_score)\n* Python port: [stringslipper by Yesudeep Mangalapilly](https://github.com/gorakhargosh/stringslipper)\n* Ruby ports:\n * [scorer by Matt Duncan](https://github.com/mrduncan/scorer)\n * [string_score_ruby by James Lindley](https://github.com/jlindley/string_score_ruby)\n* Java: [string_score by Shingo Omura](https://github.com/everpeace/string-score)\n* 4GL: [string_score by Antonio Pérez](https://github.com/skarcha/string_score)\n* Objective-C [StringScore by Nicholas Bruning](https://github.com/thetron/StringScore)\n\n# Notes\nstring_score.js does not have any external dependencies\nother than a reasonably new JavaScript interpreter.\n\nThe tests located in the tests folder rely on the files\nlocated in the tests folder.\n\n# Credits\nAuthor [Joshaven Potter](mailto:yourtech@gmail.com)\n\nThank you Lachie Cox and Quicksilver for inspiration.\n\n###Contributors\nContributing Members: [https://github.com/joshaven/string_score/network/members](https://github.com/joshaven/string_score/network/member)\n\n# License\nLicensed under the [MIT license](http://www.opensource.org/licenses/mit-license.php).\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git://github.com/joshaven/string_score.git" }, "version": "0.1.20" }