Class txtFileProcessor

java.lang.Object
edu.odu.cs.cs350.txtFileProcessor

public class txtFileProcessor extends Object
A utility class for processing plain text (.txt) files.
  • Constructor Details

    • txtFileProcessor

      public txtFileProcessor(String filePath)
      Constructor for txtFileProcessor.
      Parameters:
      filePath - the path to the text file to be processed
  • Method Details

    • getFilePath

      public String getFilePath()
      Returns the file path associated with this text file processor.
      Returns:
      the file path
    • processFile

      public Document processFile()
      Reads the text file and converts it into a Document object, using tokenization and removing common stopwords.
      Returns:
      a Document object representing the file's contents, or null if the file is invalid