eros-0.5.3.1: A text censorship library.

Portabilityarchlinux
Stabilityexperimental
MaintainerPeter Harpending <pharpend2@gmail.com>
Safe HaskellNone

Text.Eros.Phrase

Description

 

Synopsis

Documentation

data Phrase Source

A Phrase is a piece of Text, with an int representing its weight. These are the used internally within eros, in Trees.

Constructors

Phrase 

Fields

phrase :: Text
 
score :: Int
 

type PhraseMap = Map Text PhraseTreeSource

A Map of text values the appropriate tree

treeScore :: PhraseTree -> IntSource

The score of the PhraseTree is the sum of the scores of its Nodes.

forestPhrases :: [PhraseTree] -> [Text]Source

Given a list of PhraseTrees, return the top-level phrases.

forestPhrase :: PhraseTree -> TextSource

Given a PhraseTree, return the top-level phrase.

mkMap :: PhraseForest -> PhraseMapSource

Given a list of PhraseTrees, return a map of each phrase with the appropriate tree.