Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct spelling of separator #223

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Replace array-like string access with ES3 compatible `String.prototype.charAt` [#186](https://github.com/olivernn/lunr.js/pull/186), thanks [jkellerer](https://github.com/jkellerer).
* Move empty string filtering from `lunr.trimmer` to `lunr.Pipeline.prototype.run` so that empty tokens do not enter the index, regardless of the trimmer being used [#178](https://github.com/olivernn/lunr.js/issues/178), [#177](https://github.com/olivernn/lunr.js/issues/177) and [#174](https://github.com/olivernn/lunr.js/issues/174)
* Allow tokenization of arrays with null and non string elements [#172](https://github.com/olivernn/lunr.js/issues/172).
* Parameterize the seperator used by `lunr.tokenizer`, fixes [#102](https://github.com/olivernn/lunr.js/issues/102).
* Parameterize the separator used by `lunr.tokenizer`, fixes [#102](https://github.com/olivernn/lunr.js/issues/102).

## 0.5.12

Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ <h2>tokenizer</h2>
</header>

<section>
<p>A function for splitting a string into tokens ready to be inserted into the search index. Uses <code>lunr.tokenizer.seperator</code> to split strings, change the value of this property to change how strings are split into tokens.</p>
<p>A function for splitting a string into tokens ready to be inserted into the search index. Uses <code>lunr.tokenizer.separator</code> to split strings, change the value of this property to change how strings are split into tokens.</p>
</section>


Expand Down
4 changes: 2 additions & 2 deletions example/example_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -2117,8 +2117,8 @@
"view_count": 11,
"score": 0,
"community_owned": false,
"title": "seperate validation of two forms with jquery",
"body": "<p>I have two forms in one page and i would like to validate each form seperatly DEPENDING on what the user fills. So basically the user must fill only ONE form and NOT both of them...SO basically if the user fills up form number 1, the validation will be on form 1 ONLY..</p>\n\n<p>Below please find the code of both forms:</p>\n\n<pre><code> &lt;form action=\"/registration.flow\" method=\"post\" id=\"formElem1\" name=\"formElem1\" autocomplete='off'&gt;\n &lt;label for=\"Name_First\"&gt;First Name:&lt;/label&gt;\n &lt;input type=\"text\" name=\"Name_First\" id=\"Name_First\" value=\"\" class=\"required\" maxlength=\"128\" /&gt;\n &lt;label for=\"Name_Last\"&gt;Last Name:&lt;/label&gt;\n &lt;input type=\"text\" name=\"Name_Last\" id=\"Name_Last\" value=\"\" class=\"required\" maxlength=\"128\" /&gt;\n\n &lt;button id=\"registerButton\" type=\"submit\"&gt;Register&lt;/button&gt;\n&lt;/form&gt;\n\n\n&lt;form action=\"/registration.flow\" method=\"post\" id=\"formElem2\" name=\"formElem2\" autocomplete='off'&gt;\n &lt;label for=\"Name_First\"&gt;First Name:&lt;/label&gt;\n &lt;input type=\"text\" name=\"Name_First\" id=\"Name_First\" value=\"\" class=\"required\" maxlength=\"128\" /&gt;\n &lt;label for=\"Name_Last\"&gt;Last Name:&lt;/label&gt;\n &lt;input type=\"text\" name=\"Name_Last\" id=\"Name_Last\" value=\"\" class=\"required\" maxlength=\"128\" /&gt;\n\n &lt;button id=\"registerButton\" type=\"submit\"&gt;Register&lt;/button&gt;\n&lt;/form&gt;\n</code></pre>\n\n<p>Can someone help me please?? THANKS</p>\n"
"title": "separate validation of two forms with jquery",
"body": "<p>I have two forms in one page and i would like to validate each form separately DEPENDING on what the user fills. So basically the user must fill only ONE form and NOT both of them...SO basically if the user fills up form number 1, the validation will be on form 1 ONLY..</p>\n\n<p>Below please find the code of both forms:</p>\n\n<pre><code> &lt;form action=\"/registration.flow\" method=\"post\" id=\"formElem1\" name=\"formElem1\" autocomplete='off'&gt;\n &lt;label for=\"Name_First\"&gt;First Name:&lt;/label&gt;\n &lt;input type=\"text\" name=\"Name_First\" id=\"Name_First\" value=\"\" class=\"required\" maxlength=\"128\" /&gt;\n &lt;label for=\"Name_Last\"&gt;Last Name:&lt;/label&gt;\n &lt;input type=\"text\" name=\"Name_Last\" id=\"Name_Last\" value=\"\" class=\"required\" maxlength=\"128\" /&gt;\n\n &lt;button id=\"registerButton\" type=\"submit\"&gt;Register&lt;/button&gt;\n&lt;/form&gt;\n\n\n&lt;form action=\"/registration.flow\" method=\"post\" id=\"formElem2\" name=\"formElem2\" autocomplete='off'&gt;\n &lt;label for=\"Name_First\"&gt;First Name:&lt;/label&gt;\n &lt;input type=\"text\" name=\"Name_First\" id=\"Name_First\" value=\"\" class=\"required\" maxlength=\"128\" /&gt;\n &lt;label for=\"Name_Last\"&gt;Last Name:&lt;/label&gt;\n &lt;input type=\"text\" name=\"Name_Last\" id=\"Name_Last\" value=\"\" class=\"required\" maxlength=\"128\" /&gt;\n\n &lt;button id=\"registerButton\" type=\"submit\"&gt;Register&lt;/button&gt;\n&lt;/form&gt;\n</code></pre>\n\n<p>Can someone help me please?? THANKS</p>\n"
},
{
"tags": [
Expand Down
8 changes: 4 additions & 4 deletions lib/tokenizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@

/**
* A function for splitting a string into tokens ready to be inserted into
* the search index. Uses `lunr.tokenizer.seperator` to split strings, change
* the search index. Uses `lunr.tokenizer.separator` to split strings, change
* the value of this property to change how strings are split into tokens.
*
* @module
* @param {String} obj The string to convert into tokens
* @see lunr.tokenizer.seperator
* @see lunr.tokenizer.separator
* @returns {Array}
*/
lunr.tokenizer = function (obj) {
if (!arguments.length || obj == null || obj == undefined) return []
if (Array.isArray(obj)) return obj.map(function (t) { return lunr.utils.asString(t).toLowerCase() })

return obj.toString().trim().toLowerCase().split(lunr.tokenizer.seperator)
return obj.toString().trim().toLowerCase().split(lunr.tokenizer.separator)
}

/**
Expand All @@ -27,7 +27,7 @@ lunr.tokenizer = function (obj) {
* @static
* @see lunr.tokenizer
*/
lunr.tokenizer.seperator = /[\s\-]+/
lunr.tokenizer.separator = /[\s\-]+/

/**
* Loads a previously serialised tokenizer.
Expand Down
8 changes: 4 additions & 4 deletions lunr.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,19 @@ lunr.EventEmitter.prototype.hasHandler = function (name) {

/**
* A function for splitting a string into tokens ready to be inserted into
* the search index. Uses `lunr.tokenizer.seperator` to split strings, change
* the search index. Uses `lunr.tokenizer.separator` to split strings, change
* the value of this property to change how strings are split into tokens.
*
* @module
* @param {String} obj The string to convert into tokens
* @see lunr.tokenizer.seperator
* @see lunr.tokenizer.separator
* @returns {Array}
*/
lunr.tokenizer = function (obj) {
if (!arguments.length || obj == null || obj == undefined) return []
if (Array.isArray(obj)) return obj.map(function (t) { return lunr.utils.asString(t).toLowerCase() })

return obj.toString().trim().toLowerCase().split(lunr.tokenizer.seperator)
return obj.toString().trim().toLowerCase().split(lunr.tokenizer.separator)
}

/**
Expand All @@ -209,7 +209,7 @@ lunr.tokenizer = function (obj) {
* @static
* @see lunr.tokenizer
*/
lunr.tokenizer.seperator = /[\s\-]+/
lunr.tokenizer.separator = /[\s\-]+/

/**
* Loads a previously serialised tokenizer.
Expand Down
2 changes: 1 addition & 1 deletion perf/env/jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,7 @@ jQuery.fn.extend({
classNames = value.split( rspaces );

while ( (className = classNames[ i++ ]) ) {
// check each className given, space seperated list
// check each className given, space separated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
Expand Down