Skip to content

Commit

Permalink
Build version 0.5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
olivernn committed Apr 9, 2015
1 parent cec7e09 commit 4cc4612
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 51 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.mdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.5.8

* Fix typo when referencing Martin Porter's home page http://tartarus.org/~martin/ [#132](https://github.com/olivernn/lunr.js/pull/132) thanks [James Aylett](https://github.com/jaylett)
* Performance improvement for tokenizer [#139](https://github.com/olivernn/lunr.js/pull/139) thanks [Arun Srinivasan](https://github.com/satchmorun)
* Fix vector magnitude caching bug :flushed: [#142](https://github.com/olivernn/lunr.js/pull/142) thanks [Richard Poole](https://github.com/richardpoole)
* Fix vector insertion bug that prevented lesser ordered nodes to be inserted into a vector [#143](https://github.com/olivernn/lunr.js/pull/143) thanks [Richard Poole](https://github.com/richardpoole)
* Fix inefficient use of arguments in SortedSet add method, thanks to [Max Nordlund](https://github.com/maxnordlund).
* Fix deprecated use of path.exists in test server [#141](https://github.com/olivernn/lunr.js/pull/141) thanks [wei song](https://github.com/weixsong)

## 0.5.7

* Performance improvement for stemmer [#124](https://github.com/olivernn/lunr.js/pull/124) thanks [Tony Jacobs](https://github.com/tony-jacobs)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.7
0.5.8
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lunr.js",
"version": "0.5.7",
"version": "0.5.8",
"main": "lunr.js",
"ignore": [
"tests/",
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lunr",
"repo": "olivernn/lunr.js",
"version": "0.5.7",
"version": "0.5.8",
"description": "Simple full-text search in your browser.",
"license": "MIT",
"main": "lunr.js",
Expand Down
15 changes: 9 additions & 6 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/example_index.json

Large diffs are not rendered by default.

68 changes: 31 additions & 37 deletions lunr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.5.7
* Copyright (C) 2014 Oliver Nightingale
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.5.8
* Copyright (C) 2015 Oliver Nightingale
* MIT Licensed
* @license
*/
Expand Down Expand Up @@ -56,10 +56,10 @@ var lunr = function (config) {
return idx
}

lunr.version = "0.5.7"
lunr.version = "0.5.8"
/*!
* lunr.utils
* Copyright (C) 2014 Oliver Nightingale
* Copyright (C) 2015 Oliver Nightingale
*/

/**
Expand All @@ -83,7 +83,7 @@ lunr.utils.warn = (function (global) {

/*!
* lunr.EventEmitter
* Copyright (C) 2014 Oliver Nightingale
* Copyright (C) 2015 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -165,7 +165,7 @@ lunr.EventEmitter.prototype.hasHandler = function (name) {

/*!
* lunr.tokenizer
* Copyright (C) 2014 Oliver Nightingale
* Copyright (C) 2015 Oliver Nightingale
*/

/**
Expand All @@ -180,27 +180,12 @@ lunr.tokenizer = function (obj) {
if (!arguments.length || obj == null || obj == undefined) return []
if (Array.isArray(obj)) return obj.map(function (t) { return t.toLowerCase() })

var str = obj.toString().replace(/^\s+/, '')

for (var i = str.length - 1; i >= 0; i--) {
if (/\S/.test(str.charAt(i))) {
str = str.substring(0, i + 1)
break
}
}

return str
.split(/(?:\s+|\-)/)
.filter(function (token) {
return !!token
})
.map(function (token) {
return token.toLowerCase()
})
return obj.toString().trim().toLowerCase().split(/[\s\-]+/)
}

/*!
* lunr.Pipeline
* Copyright (C) 2014 Oliver Nightingale
* Copyright (C) 2015 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -417,7 +402,7 @@ lunr.Pipeline.prototype.toJSON = function () {
}
/*!
* lunr.Vector
* Copyright (C) 2014 Oliver Nightingale
* Copyright (C) 2015 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -457,13 +442,19 @@ lunr.Vector.Node = function (idx, val, next) {
* @memberOf Vector.
*/
lunr.Vector.prototype.insert = function (idx, val) {
this._magnitude = undefined;
var list = this.list

if (!list) {
this.list = new lunr.Vector.Node (idx, val, list)
return this.length++
}

if (idx < list.idx) {
this.list = new lunr.Vector.Node (idx, val, list)
return this.length++
}

var prev = list,
next = list.next

Expand All @@ -487,7 +478,7 @@ lunr.Vector.prototype.insert = function (idx, val) {
* @memberOf Vector
*/
lunr.Vector.prototype.magnitude = function () {
if (this._magniture) return this._magnitude
if (this._magnitude) return this._magnitude
var node = this.list,
sumOfSquares = 0,
val
Expand Down Expand Up @@ -542,7 +533,7 @@ lunr.Vector.prototype.similarity = function (otherVector) {
}
/*!
* lunr.SortedSet
* Copyright (C) 2014 Oliver Nightingale
* Copyright (C) 2015 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -580,10 +571,13 @@ lunr.SortedSet.load = function (serialisedData) {
* @memberOf SortedSet
*/
lunr.SortedSet.prototype.add = function () {
Array.prototype.slice.call(arguments).forEach(function (element) {
if (~this.indexOf(element)) return
var i, element

for (i = 0; i < arguments.length; i++) {
element = arguments[i]
if (~this.indexOf(element)) continue
this.elements.splice(this.locationFor(element), 0, element)
}, this)
}

this.length = this.elements.length
}
Expand Down Expand Up @@ -780,7 +774,7 @@ lunr.SortedSet.prototype.toJSON = function () {
}
/*!
* lunr.Index
* Copyright (C) 2014 Oliver Nightingale
* Copyright (C) 2015 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -1201,7 +1195,7 @@ lunr.Index.prototype.use = function (plugin) {
}
/*!
* lunr.Store
* Copyright (C) 2014 Oliver Nightingale
* Copyright (C) 2015 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -1297,13 +1291,13 @@ lunr.Store.prototype.toJSON = function () {

/*!
* lunr.stemmer
* Copyright (C) 2014 Oliver Nightingale
* Copyright (C) 2015 Oliver Nightingale
* Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
*/

/**
* lunr.stemmer is an english language stemmer, this is a JavaScript
* implementation of the PorterStemmer taken from http://tartaurs.org/~martin
* implementation of the PorterStemmer taken from http://tartarus.org/~martin
*
* @module
* @param {String} str The string to stem
Expand Down Expand Up @@ -1515,7 +1509,7 @@ lunr.stemmer = (function(){
lunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer')
/*!
* lunr.stopWordFilter
* Copyright (C) 2014 Oliver Nightingale
* Copyright (C) 2015 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -1662,7 +1656,7 @@ lunr.stopWordFilter.stopWords.elements = [
lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter')
/*!
* lunr.trimmer
* Copyright (C) 2014 Oliver Nightingale
* Copyright (C) 2015 Oliver Nightingale
*/

/**
Expand All @@ -1688,7 +1682,7 @@ lunr.trimmer = function (token) {
lunr.Pipeline.registerFunction(lunr.trimmer, 'trimmer')
/*!
* lunr.stemmer
* Copyright (C) 2014 Oliver Nightingale
* Copyright (C) 2015 Oliver Nightingale
* Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
*/

Expand Down
Loading

0 comments on commit 4cc4612

Please sign in to comment.