Class TextLoader

java.lang.Object
com.hw.langchain.document.loaders.base.BaseLoader
com.hw.langchain.document.loaders.text.TextLoader

public class TextLoader extends BaseLoader
Load text files.
Author:
HamaWhite
  • Constructor Details

    • TextLoader

      public TextLoader(String filePath)
    • TextLoader

      public TextLoader(String filePath, Charset encoding, boolean autodetectEncoding)
      Load text files.
      Parameters:
      filePath - Path to the file to load.
      encoding - File encoding to use. If `null`, the file will be loaded with the default system encoding.
      autodetectEncoding - Whether to try to autodetect the file encoding if the specified encoding fails.
  • Method Details

    • load

      public List<Document> load()
      Load from file path.
      Specified by:
      load in class BaseLoader
      Returns:
      a List which is materialized in memory.