duckling-0.1.4.0: A Haskell library for parsing text into structured data.

Safe HaskellNone
LanguageHaskell2010

Duckling.Types.Document

Synopsis

Documentation

byteStringFromPos :: Document -> Int -> (ByteString, (Int, Int) -> Text, Int -> Int -> (Int, Int)) Source #

Given a document and an offset (think Text.drop offset), returns a utf8 encoded substring of Document at that offset and 2 translation functions: rangeToText - given a range in the returned ByteString, gives a corresponding subrange of the Document as Text translateRange - given a start and a length of a range in the returned ByteString, gives a corresponding subrange in the Document as pair of (start, end) of Text.drop offsets