Closed remkoboschker closed 7 years ago
Hi @remkoboschker,
true
as the second parameter to liblevenshtein.Builder#dictionary(Array, Boolean)
."I would like to store it in something like redis"
The library does not support this directly, but you could use the low-level constructor for building a DAWG, pass the DAWG as the first parameter to liblevenshtein.Builder#dictionary(Array, Boolean)
, and store the DAWG in Redis for reuse. When you need the transducer again, you may retrieve the DAWG from Redis and pass it directly to liblevenshtein.Builder#dictionary(Array, Boolean)
.
list
, pass list
as the singleton parameter to the constructor liblevenshtein.Dawg(Array)
, like so:var dawg = new liblevenshtein.Dawg(list); // or retrieve it from Redis
var builder = new levenshtein.Builder().dictionary(dawg);
var transducer = builder.transducer();
Thank you for your replies. I'll get the list sorted, store the dawg and pass it to the constructor for faster setup. Does the java lib support updating the dawg incrementally as mentioned in the #13 and #14 3.0 milestone enhancements?
Not yet, but that will be one of the next features I add.
Hi,
I would like to use this module to find spelling alternates for strings. My dictionary has about 4 million words in it. Building the dawg takes a long time and I would like to store it in something like redis. Could you provide any advice? Does the whole graph need to be loaded in memory or can I retrieve nodes or part of the graph as alternates are accepted?
I'm using the javascript library. Perhaps any Java functionality needs porting to facilitate it?