Ruby Quiz Idea

L

Lyndon Samson

All this fidding with bits in the Thread "How to get non-unique
elements from an array" got me digressing to search engines and
indexing.

So if you have for example

Doc1=3DThe quick brown fox

Doc2=3DJumped over the brown dog

Doc3=3DCut him to the quick

You can build a table with bit number and word.

1 the
2 quick
3 brown
4 fox
5 jumped
6 over
7 dog
8 cut
9 him
10 to
11 quick

To create indices

Doc1=3D00000001111
Doc2=3D00001110101
Doc3=3D11110000011

You can very quickly return the Docs that contain 'the' [
Doc1,Doc2,Doc3 ], or brown [ Doc1,Doc2 ] etc.

The rubyquiz idea would be to write a simple indexer/query system.
 
J

James Edward Gray II

All this fidding with bits in the Thread "How to get non-unique
elements from an array" got me digressing to search engines and
indexing.

[snip quiz idea]

Is there any interest in this? I'm fine with running it, if anybody
thinks they would like to work it.

James Edward Gray II
 
R

Ryan Leavengood

Is there any interest in this? I'm fine with running it, if anybody
thinks they would like to work it.

It sounds interesting to me. Despite doing all the benchmarking I
never did create my own solution for the non-unique array elements
problem, so it might be fun to take part in a similar exercise for a
quiz.

In the spirit of that thread, I think part of the quiz should be to
solve the indexing problem in the shortest, most elegant, yet fastest
way possible. Maybe that goes without saying, but I've seen some
pretty long quiz solutions in the past.

Ryan
 
A

Ara.T.Howard

It sounds interesting to me. Despite doing all the benchmarking I
never did create my own solution for the non-unique array elements
problem, so it might be fun to take part in a similar exercise for a
quiz.

In the spirit of that thread, I think part of the quiz should be to
solve the indexing problem in the shortest, most elegant, yet fastest
way possible. Maybe that goes without saying, but I've seen some
pretty long quiz solutions in the past.

memory should could too - the user should at least provide a big estimage of
memory usage..

-a
--
===============================================================================
| email :: ara [dot] t [dot] howard [at] noaa [dot] gov
| phone :: 303.497.6469
| anything that contradicts experience and logic should be abandoned.
| -- h.h. the 14th dalai lama
===============================================================================
 
J

James Edward Gray II

It sounds interesting to me. Despite doing all the benchmarking I
never did create my own solution for the non-unique array elements
problem, so it might be fun to take part in a similar exercise for a
quiz.

I've added this problem to the quiz queue. It will show up in a few
weeks.

Thank you both.

James Edward Gray II
 
D

David Balmain

------=_Part_9693_27332356.1129871854326
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hey guys,

Also check out Ferret for another ruby indexing library.

http://ferret.davebalmain.com/trac

But this quiz is still a great idea. It was something I thought about while
writing Ferret. It will be interesting to see what people come up with. I'l=
l
certainly be partaking. As Ryan mentioned, the goal should be to solve the
problem in the shortest, most elegant, yet fastest
way possible.

HINT: From the OP's example, you'll get much better search speeds for large
document sets by inverting the index.

Regards,
Dave

I've added this problem to the quiz queue. It will show up in a few
weeks.

Thank you both.

James Edward Gray II

------=_Part_9693_27332356.1129871854326--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top