argusdusty / ferret Goto Github PK
View Code? Open in Web Editor NEWAn optimized substring search engine written in Go
License: Apache License 2.0
An optimized substring search engine written in Go
License: Apache License 2.0
dictionaryexample.go splits the dictionary.dat file by "\r\n" but the dictionary.dat file has only "\n" line endings. Consequently, it fails to build the word table.
// ResultsLimit: Limit the results to some number of values. Set to -1 for no limit
func (IS *InvertedSuffix) Query(Word string, ResultsLimit int) ([]string, []interface{}) {
Query := IS.Converter(Word)
Results := make([]string, 0, ResultsLimit)
Values := make([]interface{}, 0, ResultsLimit)
So setting ResultsLimit to -1
as documented results in make([]string, 0, -1)
which results in panic: runtime error: makeslice: cap out of range
at runtime.
How there.
Thank you for awesome package. Is Ferret can be used to index and search unicode text? I mean without UnicodeToASCII conversation?
Example code didn't build for me until I capitalized the 'f' in 'Ferret' in the import statements. I changed:
"github.com/argusdusty/ferret"
to:
"github.com/argusdusty/Ferret"
Please, add info on average & worst complexity in godoc comments for each function.
Also, in godoc comments for "Insert" function, you refer to "MakeInvertedSuffix", which is not present - supposedly that was an old name and you mean the "New" function?
Also, you have lots of deeply nested ifs in your code - you could consider using 'continue' in ifs in loops, to ease reading.
Also, you have quite a few exact repetitions of big chunks of code, I strongly advise to seriously consider extracting them to functions, or please at least comment if that's as is because of Serious Optimizations Totally Backed By Measurements And Not Premature, otherwise (paired with the issue above) they make reading the codebase highly tedious and irritating.
thanks.
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.