indiesquidge / autocomplete Goto Github PK
View Code? Open in Web Editor NEWlow-level, primitive autocomplete using trie data structure
License: MIT License
low-level, primitive autocomplete using trie data structure
License: MIT License
Requesting to delete a word with some matching prefix to an existing word throws a useful error
const completion = createTrie()
completion.insert('list')
completion.delete('lis') // throws `Error: foo is not a word, nothing deleted`
But if I request to delete a word with no matching prefix to an existing word, the error thrown is not helpful
const completion = createTrie()
completion.delete('foo') // throws `TypeError: Cannot read property 'getIsCompleteString' of undefined`
I would expect the latter snippet to throw the same error as the former snippet.
If my query includes an inserted word as a prefix, it includes my query in the list of suggestions.
If my query starts with the same letter as an inserted word, I get a strange suggestion that appears to be the merging of the query and the inserted word.
const completion = createTrie();
completion.suggest("listening"); // should be [], got []
completion.insert("list");
completion.suggest("listening"); // should still be [], got ["listening"]
completion.suggest("lost"); // should still be [], got ["lostist"] (!!!)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.