File & matrix I/O

File reader/writer, constant-memory streaming corpus reader (File::SeparatorReader) with byte-offset checkpointing, and generic MatrixBase<T>.

class File JBit · File/File.h · 4 members

Cross-platform file I/O with sentence/document splitting, sliding-window word chunking, and constant-RAM streaming.

static SeparatorReader streamFileBySeparator(const std::string &path, const std::string &separator, bool trimEntries = true, bool skipEmpty = true, std::size_t bufferBytes = 1u << 20, std::size_t maxSegmentBytes = 1u << 20); Streams multi-gigabyte files with constant memory.
static std::vector<std::string> splitFileBySeparator(const std::string &path, const std::string &separator = ".", bool trimEntries = true, bool skipEmpty = true);
std::vector<std::string> splitByWordCount(std::size_t wordsPerChunk, std::size_t overlapWords = 0) const;
std::vector<std::string> readAllLines(bool skipEmptyLines = false) const / std::string readAllText() const / std::vector<uint8_t> readAllBytes() const;
class SeparatorReader JBit::File · File/File.h · 2 members

Constant-memory delimiter scanner with exact byte position() and seek(offset) for resumable training.

bool next(std::string &segment); Yields the next trimmed non-empty segment; returns false at EOF.
uint64_t position() const / bool seek(uint64_t offset) / uint64_t size() const;
class MatrixBase JBit · File/Matrix/MatrixBase.h · 2 members
template<class T>

Templated 2D matrix backing PixelMatrix (MatrixBase<PIXEL>) and Matrix (MatrixBase<double>).

MatrixBase(const unsigned int rowCount, const unsigned int columnCount, const T defaultValue = T{});
Ra<T> operator[](unsigned int i) / T &get(unsigned int i, unsigned int j) / void set(unsigned int i, unsigned int j, const T &value);
Free functions & typedefs2
typedef MatrixBase<PIXEL> PixelMatrix;
typedef MatrixBase<double> Matrix;