hunt-searchengine-0.3.0.0: A search and indexing engine.

Safe HaskellNone
LanguageHaskell98

Hunt.Common.Positions

Description

Positions within document.

Synopsis

Documentation

newtype Positions Source

The positions of the word in the document.

Constructors

PS 

Fields

unPS :: IntSet
 

empty :: Positions Source

Empty positions.

singleton :: Position -> Positions Source

Positions with one element.

null :: Positions -> Bool Source

Test whether it is the empty positions.

member :: Position -> Positions -> Bool Source

Whether the Position is part of Positions.

toAscList :: Positions -> [Position] Source

Converts Positions to a list of Positions in ascending order.

fromList :: [Position] -> Positions Source

Constructs Positions from a list of Positions.

size :: Positions -> Int Source

Number of Positions.

foldr :: (Position -> r -> r) -> r -> Positions -> r Source

A fold over Positions

intersectionWithDispl :: Int -> Positions -> Positions -> Positions Source

intersection with a "shifted" 2. set with elements decremented by a displacement d before the element test

useful when searching for sequences of words (phrases)

intersectionWithIntervall :: Int -> Int -> Positions -> Positions -> Positions Source

intersction with "fuzzy" element test. All elements e1 for which an element e2 in s2 is found with e2 - e1 elem [lb..ub] remain in set s1.

Useful for context search with sequences of words. This generatizes intersectionWithDispl

Law: intersectionWithIntervall d d == intersectionWithDispl d