Glench / fuzzyset.js

fuzzyset.js - A fuzzy string set for javascript
http://glench.github.io/fuzzyset.js/
Other
1.37k stars 105 forks source link

Not issue but question - how to store fuzzyset object in memory for later use? #45

Closed gosforth closed 4 years ago

gosforth commented 4 years ago

Maybe this is noob question but I do not know how to handle it. Normal us is:

a = FuzzySet();
Loop:
 a.add("some text");
End lopp
a.get("sme tekst");

But to speed up I'd like to load all items and avoid repeating this for later several search processes. Just use 'a.get()' later. Is there any way to store this object in memory?

Glench commented 4 years ago

I think to fully answer your question I’d have to have more info about what you’re doing but you can give an array to FuzzySet:

var someSet = FuzzySet([‘some text’, ‘more text’])

gosforth commented 4 years ago

I'm testing if Fuzzyset would be good to search article within100 thousands of rows . My tool is Pentaho PDI. So initially I want to load object with these 100 thousands of articles (for now it works really fast). Then I have list of articles as to find matches in the previously loaded object. Search is done in another step so this is another JS session.

Glench commented 4 years ago

Unfortunately I don’t know anything about Pentaho PDI so I can’t really support you on this. In browser or Node contexts it is quite easy to save fuzzyset in memory.

gosforth commented 4 years ago

OK, thank you very much for your assistance. I will try to find how to save object to session and retrieve it from session later (there must be some way).