HaskellWiki

Haskell | Wiki community | Recent changes
Random page | Special pages

 

Not logged in
Log in | Help

Haskell Quiz/Index and Query

< Haskell Quiz

Categories: Haskell Quiz

Ruby Quiz #54:

An indexing scheme where you number all encountered words ascendingly and represent the content of a file as bit-array with the bit at position 2^i representing the i'th word.

So if you have for example:

Doc1=The quick brown fox
Doc2=Jumped over the brown dog
Doc3=Cut him to the quick

This would yield:

Doc1=00000001111
Doc2=00001110101
Doc3=11110000011

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

1 The Problem

2 Solutions

Retrieved from "http://www.haskell.org/haskellwiki/Haskell_Quiz/Index_and_Query"

This page has been accessed 788 times. This page was last modified 10:28, 13 January 2007. Recent content is available under a simple permissive license.