Current section

Files

Jump to
xberg lib xberg chunking_reason.ex
Raw

lib/xberg/chunking_reason.ex

# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:27b14662489dbd72bffe76d749cce63acd51fb05b9d0eea856452c7d4c92c223
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
defmodule Xberg.ChunkingReason do
@moduledoc "Reason for chunking a document."
@typedoc "Reason for chunking a document."
@type t :: term()
@typedoc "File exceeds size threshold."
@type large_file :: %{type: :large_file, size_bytes: non_neg_integer(), threshold_bytes: non_neg_integer()}
@typedoc "Document has many pages."
@type many_pages :: %{type: :many_pages, page_count: non_neg_integer(), threshold: non_neg_integer()}
@typedoc "PDF requires OCR and is large."
@type ocr_required :: %{type: :ocr_required, page_count: non_neg_integer(), force_ocr: boolean()}
@typedoc "Both size and page count exceed thresholds."
@type large_and_many_pages :: %{type: :large_and_many_pages, size_bytes: non_neg_integer(), page_count: non_neg_integer()}
def large_file(size_bytes, threshold_bytes), do: {:large_file, %{size_bytes: size_bytes, threshold_bytes: threshold_bytes}}
def many_pages(page_count, threshold), do: {:many_pages, %{page_count: page_count, threshold: threshold}}
def ocr_required(page_count, force_ocr), do: {:ocr_required, %{page_count: page_count, force_ocr: force_ocr}}
def large_and_many_pages(size_bytes, page_count), do: {:large_and_many_pages, %{size_bytes: size_bytes, page_count: page_count}}
end