diff -NbBu3r wikipedia-suggest-0.31/CHANGELOG wikipedia-suggest-0.31-modified/CHANGELOG
--- wikipedia-suggest-0.31/CHANGELOG 1970-01-01 10:00:00.000000000 +1000
+++ wikipedia-suggest-0.31-modified/CHANGELOG 2006-08-14 17:28:02.000000000 +1000
@@ -0,0 +1,53 @@
+
+== Version 0.31, released 12-Aug-2006 ==
+
+* TcpQuery output is now in JSON format.
+* Added experimental autocomplete feature.
+* Benchmarking: TcpQuery with MemoryQuery backend and 5
+ threads on my computer (Pentium D930). I used 10 threads to simulate
+ queries. I handled 154000 random queries in 24.7 seconds with CPU usage
+ of 100% (about 6234 queries per second).
+
+== Version 0.30, released 11-Aug-2006 ==
+
+* Added MemoryQuery backend to TcpQuery (use the "-m" switch).
+* Added multi-threading to TcpQuery (use the "-t" switch).
+* Added heuristic to choose the correct redirection to keep (based on
+ similarity with the query)
+* Handling of articles with different capitalization (keep all
+ different capitalizations) (e.g. "Adfa" and "ADFA").
+* Added strict mode (for PHP5), changed from 'var' to 'private' to
+ keep PHP5 strict mode happy, and added quick accessor method for $res
+ attribute.
+* Removed leading "/" from paths for image directory and query.php.
+ This allows the web files to be placed in a subdirectory as well as
+ the root directory, by using relative paths instead.
+* When the user made a search (e.g. "fish"), then highlighted all
+ their search terms, then pressed delete (so that the search field was
+ now blank), then pressed arrow up or arrow down, then it would show
+ the old results (e.g. Fishing / FishBase / etc). To prevent this added
+ an "if" clause to only show results when there is something in the
+ query field.
+* Fixed problem with search for query with quotes.
+
+== Version 0.20, released 06-Aug-2006 ==
+
+* Added a small heuristic inside the compiler to have only unique
+ articles in the best records.
+* Added a backend in the compiler using slist to use less memory.
+* Added that if the user presses 'Enter' in the search textbox whilst
+ typing out a query, that it automatically choose/open/redirect to the
+ first item in the list. That way the user can type out what they want, and press
+ enter to open the first link when they have typed enough to specify it well
+ enough to get it to the top of the list, all without using the mouse.
+* Added that the user can press the down/up arrows to select/highlight a
+ specified entry on the list (including but not limited to the first
+ item), and press enter to open it. That way again the user can be lazy
+ and can select a link without using the mouse, and without typing out
+ the full title.
+* Added redirects to the index.
+* Added all php/html/js pages to the source code (in the 'extra' directory).
+
+== Version 0.10, released 02-Aug-2006 ==
+
+* Initial release, of a "google suggest"-like service for Wikipedia (EN + FR).
diff -NbBu3r wikipedia-suggest-0.31/cmd/TcpProcessingThread.cpp wikipedia-suggest-0.31-modified/cmd/TcpProcessingThread.cpp
--- wikipedia-suggest-0.31/cmd/TcpProcessingThread.cpp 2006-08-12 00:33:12.000000000 +1000
+++ wikipedia-suggest-0.31-modified/cmd/TcpProcessingThread.cpp 2006-08-14 14:00:36.000000000 +1000
@@ -122,7 +122,7 @@
{
tabulars += "[\"";
tabulars += backSlash(res[i]->getTitle());
- tabulars += "\", \"";
+ tabulars += "\",\"";
std::stringstream ss;
if (res[i]->isRedirection())
@@ -130,17 +130,17 @@
else
ss << res[i]->getFreq();
tabulars += ss.str();
- tabulars += "\", \"";
+ tabulars += "\",\"";
if (res[i]->isRedirection())
tabulars += backSlash(articles[res[i]->getRedirection() - 1].getTitle());
- tabulars += "\" ]";
+ tabulars += "\"]";
if (i + 1 != res.size())
- tabulars += ", ";
+ tabulars += ",";
}
- return "[\"" + backSlash(query) + "\", [" + tabulars + "] ]\n\n";
+ return "[" + tabulars + "]\n";
}
unsigned TcpProcessingThread::nbWaiting()
diff -NbBu3r wikipedia-suggest-0.31/cmd/TcpQuery.cpp wikipedia-suggest-0.31-modified/cmd/TcpQuery.cpp
--- wikipedia-suggest-0.31/cmd/TcpQuery.cpp 2006-08-12 00:36:54.000000000 +1000
+++ wikipedia-suggest-0.31-modified/cmd/TcpQuery.cpp 2006-08-14 13:53:29.000000000 +1000
@@ -40,21 +40,21 @@
{
tabulars += "[\"";
tabulars += backSlash(v[i].getTitle());
- tabulars += "\", \"";
+ tabulars += "\",\"";
std::stringstream ss;
ss << v[i].getFreq();
tabulars += ss.str();
- tabulars += "\", \"";
+ tabulars += "\",\"";
if (v[i].isRedirection())
tabulars += backSlash(v[i].getTarget());
- tabulars += "\" ]";
+ tabulars += "\"]";
if (i + 1 != v.size())
- tabulars += ", ";
+ tabulars += ",";
}
- return "[\"" + backSlash(str) + "\", [" + tabulars + "] ]\n\n";
+ return "[" + tabulars + "]\n";
}
void version(std::ostream &os)
@@ -64,7 +64,7 @@
void usage(const std::string &name, std::ostream &os)
{
- os << "Usage : " << name << "[Options] port fsa.bin pages.bin" << std::endl
+ os << "Usage : " << name << " [Options] port fsa.bin pages.bin" << std::endl
<< std::endl
<< "Options: " << std::endl
<< " -h Print this help message" << std::endl
diff -NbBu3r wikipedia-suggest-0.31/extra/index.php wikipedia-suggest-0.31-modified/extra/index.php
--- wikipedia-suggest-0.31/extra/index.php 2006-08-12 01:40:13.000000000 +1000
+++ wikipedia-suggest-0.31-modified/extra/index.php 2006-08-14 17:16:21.000000000 +1000
@@ -43,6 +43,9 @@
+