Unicode text segmentation for OCaml
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
pkg
src
test
.gitignore
.merlin
.ocp-indent First commit. Dec 23, 2014
CHANGES.md Correct release date. Jun 6, 2018
DEVEL.md
LICENSE.md
README.md
_tags
opam

README.md

Uuseg — Unicode text segmentation for OCaml

%%VERSION%%

Uuseg is an OCaml library for segmenting Unicode text. It implements the locale independent Unicode text segmentation algorithms to detect grapheme cluster, word and sentence boundaries and the Unicode line breaking algorithm to detect line break opportunities.

The library is independent from any IO mechanism or Unicode text data structure and it can process text without a complete in-memory representation.

Uuseg depends on Uucp and optionally on Uutf for support on OCaml UTF-X encoded strings. It is distributed under the ISC license.

Homepage: http://erratique.ch/software/uuseg
Contact: Daniel Bünzli <daniel.buenzl i@erratique.ch>

Installation

Uuseg can be installed with opam:

opam install uuseg
opam install uutf uuseg # for support on OCaml UTF-X encoded strings

If you don't use opam consult the opam file for build instructions.

Documentation

The documentation and API reference is automatically generated by ocamldoc from the interfaces. It can be consulted online or via odig doc uuseg.

Sample programs

If you installed Uuseg with opam sample programs are located in the directory opam config var uuseg:doc.

In the distribution sample programs are located in the test directory of the distribution, they can be built with:

topkg build --tests true

  • test.native tests the library, nothing should fail.
  • usegtrip.native inputs Unicode text on stdin and rewrites segments on stdout. Invoke with --help for more information Depends on Uutf and Cmdliner.