barrel_ngram_source_mem (barrel_ngram v0.9.0)
View SourceIn-memory barrel_ngram_source implementation.
For tests and small corpora: InitArg is a #{DocId => binary()} map of document text, held directly as State (no process, no copy beyond the map itself).
Summary
Functions
-spec doc_size(#{binary() => binary()}, binary()) -> {ok, non_neg_integer()} | {error, term()}.
-spec pread(#{binary() => binary()}, binary(), non_neg_integer(), non_neg_integer()) -> {ok, binary()} | {error, term()}.