| HsHyperEstraier-0.1: HyperEstraier binding for Haskell | Contents | Index |
|
Text.HyperEstraier.Document |
|
|
|
|
Description |
An interface to manipulate documents of the HyperEstraier.
|
|
Synopsis |
|
|
|
|
Types
|
|
data Document |
Document is an opaque object representing a document of
HyperEstraier.
|
|
|
type DocumentID = Int |
DocumentID is just an alias to Int. It represents a
document ID.
|
|
Creating and parsing document
|
|
newDocument :: IO Document |
newDocument creates an empty document.
|
|
parseDraft :: String -> IO Document |
parseDraft parses a document in the "draft" format.
|
|
Setting contents and attributes of document
|
|
addText :: Document -> String -> IO () |
Add a block of text to a document.
|
|
addHiddenText :: Document -> String -> IO () |
Add a block of hidden text to a document.
|
|
setAttribute |
:: Document | The document.
| -> String | An attribute name.
| -> Maybe String | An attribute value. If this is
Nothing, the attribute
will be deleted.
| -> IO () | | Set an attribute value of a document.
|
|
|
setURI :: Document -> Maybe URI -> IO () |
Set an URI of a document. This is a special case of
setAttribute.
|
|
setKeywords |
:: Document | The document.
| -> [(String, Integer)] | A list of (keyword, score).
| -> IO () | | Set keywords of a document.
|
|
|
setScore :: Document -> Maybe Int -> IO () |
Set an alternative score of a document.
|
|
Getting contents and attributes of document
|
|
getId :: Document -> IO DocumentID |
Get the ID of document.
|
|
getAttrNames :: Document -> IO [String] |
Get a list of all attribute names in a document.
|
|
getAttribute :: Document -> String -> IO (Maybe String) |
Get an attribute value of a document.
|
|
getText :: Document -> IO String |
Get the text in a document.
|
|
getURI :: Document -> IO (Maybe URI) |
Get the URI of a document.
|
|
getKeywords :: Document -> IO [(String, Integer)] |
Get the keywords of a document.
|
|
getScore :: Document -> IO (Maybe Int) |
Get an alternative score of a document.
|
|
Dumping document
|
|
dumpDraft :: Document -> IO String |
Dump a document in the "draft" format.
|
|
Making snippet of document
|
|
makeSnippet |
:: Document | The document.
| -> [String] | Words to be highlighted.
| -> Int | Maximum width of the whole result.
| -> Int | Width of the heading text to be shown.
| -> Int | Width of the text surrounding each highlighted words.
| -> IO [Either String (String, String)] | A list of either
(Left
non-highlighted text)
or (Right
(highlighted word, its
normalized form)).
| Make a snippet from a document.
|
|
|
Produced by Haddock version 0.8 |