Inverted index: Difference between revisions

m
(Added BBC BASIC)
Line 700:
* create node if doesn't exist
*/
trie trie_trav(trie root, const char * str, int no_create)
{
int c;
Line 742:
}
void add_index(trie root, const char *word, const char *fname)
{
trie x = trie_trav(root, word, 0);
Line 761:
/* pretend we parsed text files and got lower cased words: dealing *
* with text file is a whole other animal and would make code too long */
const char *files[] = { "f1.txt", "source/f2.txt", "other_file" };
const char *text[][5] ={{ "it", "is", "what", "it", "is" },
{ "what", "is", "it", 0 },
{ "it", "is", "a", "banana", 0 }};
trie init_tables()
Line 781:
#define USE_ADVANCED_FILE_HANDLING 0
#if USE_ADVANCED_FILE_HANDLING
void read_file(const char * fname) {
char cmd[1024];
char word[1024];
Line 808:
}
void search_index(trie root, const char *word)
{
char path[1024];
Anonymous user