nicklondhe / wikiindexer Goto Github PK
View Code? Open in Web Editor NEWStarter code and tests for wikipedia indexer
Starter code and tests for wikipedia indexer
//same token repeated
stream = new TokenStream("hello");
stream.append("hello","hello","hello","helllo");
assertEquals(0, stream.query("test"));
assertEquals(5, stream.query("hello"));
stream = null;
in line 177 line of the origin file. I think the there is a typo on the third line. Should the helllo be hello?
for (int i = 0; i < 4; i++)
stream1.mergeWithNext();
on line 883. here is refered as (1)
//with merge with previous
stream = new TokenStream("this");
stream.append("is", "a", "test", "string");
stream.next();
stream.mergeWithPrevious();
assertEquals(0, stream.query("this"));
assertEquals(1, stream.query("this is"));
stream = null;
on line 199. here is refered as (2)
//with merge with next
stream = new TokenStream("this");
stream.append("is", "a", "test", "string");
stream.mergeWithNext();
assertEquals(0, stream.query("this"));
assertEquals(1, stream.query("this is"));
stream = null;
on line 208. here is refered as (3)
I'm not quite sure about whether here is a bug. But at code (1), the pointer of the tokenstream is before the first element. here we can only merge the following two elements. But at code (2)and (3), the test cast require us to merge the elements around the pointer(since pointer in between "this" and "is"). I think here is a conflict on the behaviour of the function.
Thank you very much!
//same token repeated
stream = new TokenStream("hello");
stream.append("hello","hello","hello","helllo");
assertEquals(0, stream.query("test"));
assertEquals(5, stream.query("hello"));
stream = null;
The last appended word is misspelled as "helllo" instead of "hello" and the test case fails.
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.