Template Function noLZSS::factorize_file_stream

Function Documentation

template<class Sink>
size_t noLZSS::factorize_file_stream(const std::string &path, Sink &&sink, size_t start_pos)

Factorizes text from a file using the noLZSS algorithm.

Advanced factorization function for file-based text.

This template function reads text directly from a file and performs factorization without loading the entire file into memory. This is more memory-efficient for large files.

This template function reads text from a file and provides low-level access to the factorization process through a sink callable.

See also

factorize_file() for the non-template version that returns a vector

Note

This function builds the suffix tree directly from the file

Template Parameters:
  • Sink – Callable type that accepts Factor objects

  • Sink – Callable type that accepts Factor objects

Parameters:
  • path – Path to input file containing text

  • sink – Callable that receives each computed factor

  • path – Path to input file containing text

  • sink – Callable that receives each computed factor

  • start_pos – Position in the text to start factorization from (default: 0)

Returns:

Number of factors emitted

Returns:

Number of factors emitted