eros-0.1.0.0: A text censorship library.

Copyright2014, Peter Harpending.
LicenseBSD3
MaintainerPeter Harpending <pharpend2@gmail.com>
Stabilityexperimental
Portabilityarchlinux
Safe HaskellSafe-Inferred
LanguageHaskell2010

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 PhraseTree Source

A Map of text values the appropriate tree

treeScore :: PhraseTree -> Int Source

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 -> Text Source

Given a PhraseTree, return the top-level phrase.

mkMap :: PhraseForest -> PhraseMap Source

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