diff options
| author | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2025-02-13 18:00:17 +1100 |
|---|---|---|
| committer | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2025-02-13 18:00:17 +1100 |
| commit | 98cef5e9a772602d42acfcf233838c760424db9a (patch) | |
| tree | 5277fa1d7cc0a69a0f166fcbf10fd320f345f049 /comp2521/tf_idf/io.h | |
initial commit
Diffstat (limited to 'comp2521/tf_idf/io.h')
| -rw-r--r-- | comp2521/tf_idf/io.h | 21 |
1 files changed, 21 insertions, 0 deletions
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 <ctype.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#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 |
