From 98cef5e9a772602d42acfcf233838c760424db9a Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Thu, 13 Feb 2025 18:00:17 +1100 Subject: initial commit --- comp2521/tf_idf/io.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 comp2521/tf_idf/io.h (limited to 'comp2521/tf_idf/io.h') diff --git a/comp2521/tf_idf/io.h b/comp2521/tf_idf/io.h new file mode 100644 index 0000000..76b225a --- /dev/null +++ b/comp2521/tf_idf/io.h @@ -0,0 +1,21 @@ +#ifndef IO_H_ +#define IO_H_ +#include +#include +#include +#include +#include + +#include "invertedIndex.h" + +// Returns a malloc'ed char* of the next word in the file. NULL otherwise. +// Undefined behaviour if the word is greater than 100 chars. +char *getNextWord(FILE *const fptr); + +// Returns true if a string in the second argument exists past the fptr in a +// file. +bool exists_after(FILE *const fptr, char *const string); + +// Outputs the contents of an inverted index to the file specified by fptr. +void writeInvertedIndex(FILE *const fptr, struct InvertedIndexNode *node); +#endif -- cgit v1.2.3