Comments (4)
Sol is no longer open source due people launching other products by forking the code.
Fuzzy search is implemented via fuse.js, with the following params:
export const FUSE_OPTIONS: Fuse.IFuseOptions<any> = {
threshold: 0.15,
ignoreLocation: true,
findAllMatches: true,
keys: [
{name: 'name', weight: 0.9},
{name: 'alias', weight: 0.1},
],
}
I don't think implementing something like "vsc" is possible with that library.
from sol.
Well that's sad to hear. What kind of products?
Here is what ChatGPT would do:
To configure fuse.js to find matches based on word initials, you can use the "tokenize" option and set it to a function that splits the search query into individual words and their initials. Here's an example:
const fuse = new Fuse(list, {
keys: ['title', 'author'],
tokenize: (query) => {
const words = query.trim().toLowerCase().split(' ');
return words.flatMap((word) => {
const initials = Array.from(word).map((char) => `${char}*`).join('');
return [word, initials];
});
},
});
In this example, the "tokenize" function takes the search query, splits it into individual words, and then maps each word to an array that contains the word itself and its initials with an asterisk appended to each character. For example, the query "vsc" would be transformed to ["vsc", "vsc*"].
By doing this, when you search for "vsc", Fuse.js will match it with any string in the list that contains "v", "s", and "c" as consecutive characters, such as "Visual Studio Code".
from sol.
God I hate chatGPT, not an intelligent answer as that will probably mess up every other result.
For example, vsc seems to work on spotlight but only for vscode, so it probably has an alias registered somewhere, not some random tokenizer running on all items.
from sol.
Related Issues (20)
- for last two (or more) versions sparkle update check results in `Update Error!` HOT 7
- Calculator in launcher HOT 3
- How to run it in dev mode? HOT 3
- How to close this app? HOT 2
- Extra features went missing after an update. HOT 3
- How do I stop Sol from disappearing in a test environment? HOT 2
- No source files HOT 1
- Opinion: make overlay optional HOT 2
- Problems with displaying on large screens HOT 2
- How to manage shortcuts HOT 4
- add option to not autostart Sol on launch HOT 7
- Persistent Clipboard History HOT 4
- website throwing 404 HOT 1
- no issue
- Find App that are symlinked HOT 1
- Cannot open Safari HOT 1
- 1.1.94 crashing - updater failing to replace app, crash soon after open after manual install, app not signed HOT 15
- Enabling notifications crashes the app HOT 5
- Linux support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sol.