HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduletext-icu-0.8.0.5Haskell98

Data.Text.ICU.Break

String breaking functions for Unicode, implemented as bindings to the International Components for Unicode (ICU) libraries.

The text boundary positions are found according to the rules described in Unicode Standard Annex #29, Text Boundaries, and Unicode Standard Annex #14, Line Breaking Properties. These are available at http://www.unicode.org/reports/tr14/ and http://www.unicode.org/reports/tr29/.

  • 3 types
  • 17 values
  • Packagetext-icu-0.8.0.5
  • Exports20
  • LanguageHaskell98
  • LicenceBSD-3-Clause
  • SourceBreak.hsc

Types

3 declarations
datadata Line
#

Line break status.

Constructors

  • Soft

    A soft line break is a position at which a line break is acceptable, but not required.

  • Hard
Instances4Enum, Eq, Show, NFData
  • Enum LineDefined in text-icu-0.8.0.5 · Data.Text.ICU.Break
  • Eq LineDefined in text-icu-0.8.0.5 · Data.Text.ICU.Break
  • Show LineDefined in text-icu-0.8.0.5 · Data.Text.ICU.Break
  • NFData LineDefined in text-icu-0.8.0.5 · Data.Text.ICU.Break
datadata Word
#

Word break status.

Constructors

  • Uncategorized

    A "word" that does not fit into another category. Includes spaces and most punctuation.

  • Number

    A word that appears to be a number.

  • Letter

    A word containing letters, excluding hiragana, katakana or ideographic characters.

  • Kana

    A word containing kana characters.

  • Ideograph

    A word containing ideographic characters.

Instances4Enum, Eq, Show, NFData
  • Enum WordDefined in text-icu-0.8.0.5 · Data.Text.ICU.Break
  • Eq WordDefined in text-icu-0.8.0.5 · Data.Text.ICU.Break
  • Show WordDefined in text-icu-0.8.0.5 · Data.Text.ICU.Break
  • NFData WordDefined in text-icu-0.8.0.5 · Data.Text.ICU.Break

Breaking functions

6 declarations

Break a string on character boundaries.

Character boundary analysis identifies the boundaries of "Extended Grapheme Clusters", which are groupings of codepoints that should be treated as character-like units for many text operations. Please see Unicode Standard Annex #29, Unicode Text Segmentation, http://www.unicode.org/reports/tr29/ for additional information on grapheme clusters and guidelines on their use.

Break a string on line boundaries.

Line boundary analysis determines where a text string can be broken when line wrapping. The mechanism correctly handles punctuation and hyphenated words.

Break a string on sentence boundaries.

Sentence boundary analysis allows selection with correct interpretation of periods within numbers and abbreviations, and trailing punctuation marks such as quotation marks and parentheses.

Break a string on word boundaries.

Word boundary analysis is used by search and replace functions, as well as within text editing applications that allow the user to select words with a double click. Word selection provides correct interpretation of punctuation marks within and following words. Characters that are not part of a word, such as symbols or punctuation marks, have word breaks on both sides.

Iteration functions

8 declarations

Important note: All of the indices accepted and returned by functions in this module are offsets into the raw UTF-16 text array, not a count of codepoints.

valuefirst :: BreakIterator a -> IO TextI
#

Reset the breaker to the beginning of the text to be scanned.

valuelast :: BreakIterator a -> IO TextI
#

Reset the breaker to the end of the text to be scanned.

valuenext :: BreakIterator a -> IO (Maybe TextI)
#

Advance the iterator and break at the text boundary that follows the current text boundary.

valueprevious :: BreakIterator a -> IO (Maybe TextI)
#

Advance the iterator and break at the text boundary that precedes the current text boundary.

valueisBoundary :: BreakIterator a -> Int -> IO Bool
#

Determine whether the specified position is a boundary position. As a side effect, leaves the iterator pointing to the first boundary position at or after the given offset.

Iterator status

2 declarations
valuegetStatus :: BreakIterator a -> IO a
#

Return the status from the break rule that determined the most recently returned break position. For rules that do not specify a status, a default value of () is returned.

valuegetStatuses :: BreakIterator a -> IO [a]
#

Return statuses from all of the break rules that determined the most recently returned break position.

Locales

1 declaration
valueavailable :: [LocaleName]
#

Locales for which text breaking information is available. A BreakIterator in a locale in this list will perform the correct text breaking for the locale.