This repository has been archived by the owner on Sep 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #203 from 30-seconds/search-optimize
- Loading branch information
Showing
13 changed files
with
185 additions
and
38 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,5 @@ | |
"foreColor": "#ffffff", | ||
"iconName": "python" | ||
}, | ||
"biasPenaltyMultiplier": 1.1 | ||
"biasPenaltyMultiplier": 1.05 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,5 +19,5 @@ | |
"foreColor": "#61dafb", | ||
"iconName": "react" | ||
}, | ||
"biasPenaltyMultiplier": 1.3 | ||
"biasPenaltyMultiplier": 1.25 | ||
} |
Submodule 30blog
updated
from 3b0a76 to c65691
Submodule 30code
updated
from ab0e3a to c45134
Submodule 30css
updated
from d658f5 to 558148
Submodule 30python
updated
from 5dace2 to 51aca2
Submodule 30react
updated
from b5a475 to 9e9e74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
import searchIndexingEngine from './searchIndexingEngine'; | ||
import searchIndexingEngine, { quickParseTokens as clientSearchEngine } from './searchIndexingEngine'; | ||
|
||
describe('searchIndexingEngine', () => { | ||
it('parses the tokens from the given string', () => { | ||
const str = 'Creates an object with the same values as the provided object and keys generated by running the provided function for each key. Use Object.keys(obj) to iterate over the object\'s keys. Use Array.prototype.reduce() to create a new object with the same values and mapped keys using fn. Additionally, yeet caress seed recreational practicality'; | ||
const result = ['creat', 'object', 'valu', 'provid', 'kei', 'gener', 'run', 'function', 'us', 'obj', 'iter', "object'", 'arrai', 'prototyp', 'reduc', 'new', 'map', 'fn', 'addition', 'yeet', 'caress', 'seed', 'recreat', 'practic']; | ||
const result = ['creat', 'object', 'same', 'valu', 'provid', 'kei', 'gener', 'run', 'function', 'each', 'us', 'obj', 'iter', 'arrai', 'prototyp', 'reduc', 'new', 'map', 'fn', 'addition', 'yeet', 'caress', 'seed', 'recreat', 'practic']; | ||
expect(searchIndexingEngine(str)).toEqual(result); | ||
}); | ||
}); | ||
|
||
describe('clientSearchEngine', () => { | ||
it('parses the tokens from the given string', () => { | ||
const str = 'Creates an object with the same values as the provided object and keys generated by running the provided function for each key. Use Object.keys(obj) to iterate over the object\'s keys. Use Array.prototype.reduce() to create a new object with the same values and mapped keys using fn. Additionally, yeet caress seed recreational practicality'; | ||
const result = ['creat', 'object', 'same', 'valu', 'as', 'provid', 'and', 'kei', 'gener', 'run', 'function', 'each', 'us', 'obj', 'to', 'iter', 'over', 'arrai', 'prototyp', 'reduc', 'new', 'map', 'fn', 'addition', 'yeet', 'caress', 'seed', 'recreat', 'practic']; | ||
expect(clientSearchEngine(str)).toEqual(result); | ||
}); | ||
}); |
Oops, something went wrong.