vxml_pipeline/split_replacement

Literal and regular-expression rules for splitting text into VXML.

Types

pub type CaptureGroupReplacement {
  CaptureGroupReplacement(
    pattern: String,
    replacement: SplitReplacement,
  )
}

Constructors

pub type RegexpSplitRule {
  RegexpSplitRule(
    regexp: regexp.Regexp,
    capture_groups: List(CaptureGroupReplacement),
  )
}

Constructors

pub type SplitReplacement {
  Keep
  Discard
  DropLastCharacter
  Tag(String)
  TagWithSegmentAsValue(String, String)
  TagWithSegmentChild(String)
  TagThenText(String, String)
  TextThenTag(String, String)
}

Constructors

  • Keep
  • Discard
  • DropLastCharacter
  • Tag(String)
  • TagWithSegmentAsValue(String, String)
  • TagWithSegmentChild(String)
  • TagThenText(String, String)
  • TextThenTag(String, String)

Values

pub fn apply_regexp_split_rule(
  vxml: vxml.VXML,
  rule: RegexpSplitRule,
) -> List(vxml.VXML)
pub fn apply_regexp_split_rules(
  vxml: vxml.VXML,
  rules: List(RegexpSplitRule),
) -> List(vxml.VXML)
pub fn naive_unescaped_split_node(
  vxml: vxml.VXML,
  splitter: String,
  escaped_splitter_replacement: String,
  replacement: SplitReplacement,
) -> List(vxml.VXML)
pub fn parenthesize(s: String) -> String

Wraps a regular-expression fragment in a capturing group.

The fragment must not contain capturing groups of its own. Use noncapturing groups ((?:...)) inside the fragment instead.

pub const regex_prefix_to_make_unescaped: String
pub fn regexp_split_rule(
  pattern pattern: String,
  replacement replacement: SplitReplacement,
) -> RegexpSplitRule

Constructs a single-group regular-expression split rule.

pattern must not contain capturing groups. Use noncapturing groups ((?:...)) inside it instead.

pub fn regexp_split_rule_for_groups(
  pairs: List(#(String, SplitReplacement)),
) -> RegexpSplitRule

Constructs a split rule from adjacent capture-group instructions.

The regular-expression fragment in each pair must not contain capturing groups. Use noncapturing groups ((?:...)) inside the fragments instead.

pub fn regexp_split_rule_to_string(
  rule: RegexpSplitRule,
) -> String
pub fn remaining_unescaped_splits(
  splits: List(String),
  escaped_splitter_replacement: String,
) -> List(String)
pub fn unescaped_regexp_split_rule(
  pattern pattern: String,
  replacement replacement: SplitReplacement,
) -> RegexpSplitRule

Constructs a split rule for an unescaped regular-expression suffix.

pattern must not contain capturing groups. Use noncapturing groups ((?:...)) inside it instead.

pub fn unescaped_suffix(suffix: String) -> String
Search Document