annotations v0.1.0 Annotations.AnnotatedString

Link to this section Summary

Functions

Tests whether the annotations in the AnnotatedString are disjoint. consider can be any of the values allowed by Annotations.List.disjoint?/2

Joins the given enumerable into a binary using joiner as a separator

splits the Annotated string in two. Each String keeps the Annotations referring to itsaelf. Annotations spanning split boundaries are duplicated to each neighboring chunk

Splits a AnnotatedString at any point within an annotation. fun is a fn str, ann-> nil|:before|:after|integer, where integer is between ann.from and ann.to

splits the string at the before or after annotations tagged with any tag in tags options: split: (:before | :after) For a general function for splitting based on Annotations look at split_by_annotation/3

Link to this section Functions

Link to this function add_annotations(str, annotations)
Link to this function capitalize(arg)
Link to this function contains?(arg, arg2)
Link to this function disjoint?(annotated_string, consider \\ nil)

Tests whether the annotations in the AnnotatedString are disjoint. consider can be any of the values allowed by Annotations.List.disjoint?/2

Link to this function ends_with?(arg, arg2)
Link to this function equivalent?(arg, arg2)
Link to this function extract_annotations(str, tags)
Link to this function extract_annotations(str, tags, options)
Link to this function jaro_distance(arg, arg2)
Link to this function join(enum, joiner \\ __MODULE__.new(" ", Annotation.new(0, 1, :joiner)))

Joins the given enumerable into a binary using joiner as a separator.

If joiner is not passed at all, it defaults to %AnnotatedString(“ “, Annotation.new(0, 1, :joiner)).

All items in the enumerable and the joiner must be AnnotatedStrings or Strings, otherwise an error is raised.

Link to this function new(str, annotations)
Link to this function next_grapheme_size(arg)
Link to this function normalize(arg, arg2)
Link to this function printable?(arg)
Link to this function select_annotation_ranges(annotated_string, fun \\ nil)
Link to this function split(annotated_string, splitter, orig_options \\ [])

splits the Annotated string in two. Each String keeps the Annotations referring to itsaelf. Annotations spanning split boundaries are duplicated to each neighboring chunk

Link to this function split_at(annotated_string, where)
Link to this function split_by_annotation(ann_str, fun, options \\ [])

Splits a AnnotatedString at any point within an annotation. fun is a fn str, ann-> nil|:before|:after|integer, where integer is between ann.from and ann.to

Link to this function split_by_tags(str, tags)
Link to this function split_by_tags(str, tags, options)

splits the string at the before or after annotations tagged with any tag in tags options: split: (:before | :after) For a general function for splitting based on Annotations look at split_by_annotation/3

Link to this function starts_with?(arg, arg2)
Link to this function tag_all(arg, re, tag \\ :default)
Link to this function to_charlist(arg)
Link to this function to_integer(arg, arg2)
Link to this function to_string(annotated_string)
Link to this function trim_leading(ann_str, to_trim \\ nil)