Chapter.Status (chapter v0.1.0)

Copy Markdown View Source

Series-level publication status normalization.

Scanlation sources report status in their own UI strings and languages — "Ongoing", "Releasing", "On-Going", "онгоинг", "завершён", "Hiatus", … — and typo/phrase variants appear with every new source. normalize/1 substring-matches the canonical English terms and known localized variants (currently English and Russian) into four buckets:

iex> Chapter.Status.normalize("Releasing")
"ongoing"

iex> Chapter.Status.normalize("завершён")
"completed"

iex> Chapter.Status.normalize("Season 2 TBA")
"unknown"

Unfamiliar phrasing falls through to "unknown" rather than getting silently mis-bucketed.

Summary

Functions

Normalize a raw status string into "ongoing" | "completed" | "hiatus" | "unknown".

Types

bucket()

@type bucket() :: String.t()

Functions

normalize(raw)

@spec normalize(String.t() | nil | term()) :: bucket()

Normalize a raw status string into "ongoing" | "completed" | "hiatus" | "unknown".