VIBE v5.1.6
Search Engine
Loading...
Searching...
No Matches
edu.usfca.cs272.InvertedIndexBuilder Class Reference
Inheritance diagram for edu.usfca.cs272.InvertedIndexBuilder:
edu.usfca.cs272.ThreadSafeInvertedIndexBuilder

Public Member Functions

 InvertedIndexBuilder (InvertedIndex invertedIndex)
 
void build (Path input) throws IOException
 
void readDirectory (Path directory) throws IOException
 
void readFile (Path file) throws IOException
 
String toString ()
 

Static Public Member Functions

static void readFile (Path file, InvertedIndex index) throws IOException
 
static boolean fileIsTXT (Path path)
 

Detailed Description

InvertedIndexBuilder Class for the Search Engine Project.

Author
Ravneet Singh Bhatia, CS 272 Software Development (University of San Francisco)
Version
Spring 2024

Constructor & Destructor Documentation

◆ InvertedIndexBuilder()

edu.usfca.cs272.InvertedIndexBuilder.InvertedIndexBuilder ( InvertedIndex invertedIndex)

Constructor for InvertedIndexBuilder Class.

Parameters
invertedIndexInvertedIndex

Member Function Documentation

◆ build()

void edu.usfca.cs272.InvertedIndexBuilder.build ( Path input) throws IOException

Triggers the build for the index.

Parameters
inputPath of input file.
Exceptions
IOExceptionif file can't be read.

Reimplemented in edu.usfca.cs272.ThreadSafeInvertedIndexBuilder.

◆ fileIsTXT()

static boolean edu.usfca.cs272.InvertedIndexBuilder.fileIsTXT ( Path path)
static

Validates file extension

Parameters
pathof file
Returns
true if file has a valid text file extension.

◆ readDirectory()

void edu.usfca.cs272.InvertedIndexBuilder.readDirectory ( Path directory) throws IOException

Reads text files in a directory or nested directories.

Parameters
directorydirectory path
Exceptions
IOExceptionif unable to read directory.

◆ readFile() [1/2]

void edu.usfca.cs272.InvertedIndexBuilder.readFile ( Path file) throws IOException

Reads text file to populate index.

Parameters
filepath of file
Exceptions
IOExceptionif file is not found.

Reimplemented in edu.usfca.cs272.ThreadSafeInvertedIndexBuilder.

◆ readFile() [2/2]

static void edu.usfca.cs272.InvertedIndexBuilder.readFile ( Path file,
InvertedIndex index ) throws IOException
static

reads text file to populate InvertedIndex.

Parameters
filepath of text file.
indexInverted index to populate
Exceptions
IOExceptionif unable to read file.

◆ toString()

String edu.usfca.cs272.InvertedIndexBuilder.toString ( )

to Stirng for the index builder

Returns
index in pretty json.

Reimplemented in edu.usfca.cs272.ThreadSafeInvertedIndexBuilder.


The documentation for this class was generated from the following file: