View Source Subtitle.WebVTT.Payload (kim_subtitle v0.1.0)
Summary
Functions
Each tag will be fragmented into a list of single word tags of the same type. If words are longer than max_length, they are wrapped.
Merges the tags until their text size falls within min_length
and max_length
. Calls simplify/1 on the final result.
Merges equals tags together. Useful after a fragment call.
Splits words when they are longer then the specified length
Functions
@spec fragment( Subtitle.WebVTT.Payload.Tag.t() | [Subtitle.WebVTT.Payload.Tag.t()], pos_integer() ) :: [ Subtitle.WebVTT.Payload.Tag.t() ]
Each tag will be fragmented into a list of single word tags of the same type. If words are longer than max_length, they are wrapped.
@spec marshal!([Subtitle.WebVTT.Payload.Tag.t()]) :: binary()
@spec merge([Subtitle.WebVTT.Payload.Tag.t()], pos_integer(), pos_integer()) :: [ [Subtitle.WebVTT.Payload.Tag.t()] ]
Merges the tags until their text size falls within min_length
and max_length
. Calls simplify/1 on the final result.
@spec pretty?(binary(), pos_integer()) :: boolean()
@spec simplify([Subtitle.WebVTT.Payload.Tag.t()]) :: [Subtitle.WebVTT.Payload.Tag.t()]
Merges equals tags together. Useful after a fragment call.
@spec unmarshal(binary()) :: {:ok, [Subtitle.WebVTT.Payload.Tag.t()]} | {:error, binary()}
@spec unmarshal!(binary()) :: [Subtitle.WebVTT.Payload.Tag.t()]
@spec wrap_words([binary()], pos_integer()) :: [binary()]
Splits words when they are longer then the specified length