citeproc-hs-0.3.2: A Citation Style Language implementation in HaskellSource codeContentsIndex
Text.CSL.Proc.Disamb
Portabilityunportable
Stabilityunstable
MaintainerAndrea Rossato <andrea.rossato@unitn.it>
Description

This module provides functions for processing the evaluated Output for citation disambiguation.

Describe the disambiguation process.

Synopsis
disambCitations :: Style -> [Reference] -> Citations -> [CitationGroup] -> ([(String, String)], [CitationGroup])
mapDisambData :: (Output -> Output) -> CiteData -> CiteData
mapCitationGroup :: ([Output] -> [Output]) -> CitationGroup -> CitationGroup
disambAddNames :: [CiteData] -> [CiteData]
disambAddLast :: [CiteData] -> [CiteData]
disambAddGivenNames :: [NameData] -> [NameData]
updateOutput :: [CiteData] -> [NameData] -> Output -> Output
reEvaluate :: Style -> [CiteData] -> [(Cite, Reference)] -> CitationGroup -> CitationGroup
hasIfDis :: IfThen -> [Bool]
getCitDisambOptions :: Style -> [String]
getDuplCiteData :: Bool -> [CitationGroup] -> [[CiteData]]
getCiteData :: Output -> [CiteData]
type NamesYear = ([Output], String)
getDuplNamesYear :: Bool -> [CitationGroup] -> [NamesYear]
getNamesYear :: Bool -> Output -> [(String, NamesYear)]
getYears :: Output -> [(String, String)]
getDuplNameData :: [CitationGroup] -> [[NameData]]
getDuplNames :: [CitationGroup] -> [[Output]]
getName :: Output -> [NameData]
generateYearSuffix :: [Reference] -> [(String, [Output])] -> [(String, String)]
setYearSuffCollision :: Bool -> [CiteData] -> [Output] -> [Output]
updateYearSuffixes :: [(String, String)] -> Output -> Output
getYearSuffixes :: Output -> [(String, [Output])]
rmYearSuff :: [CitationGroup] -> [CitationGroup]
disambiguate :: Eq a => [[a]] -> [[a]]
same :: Eq a => [a] -> [Bool]
hasDuplicates :: Eq a => [a] -> Bool
allTheSame :: Eq a => [a] -> Bool
Documentation
disambCitations :: Style -> [Reference] -> Citations -> [CitationGroup] -> ([(String, String)], [CitationGroup])Source
Given the Style, the list of references and the citation groups, disambiguate citations according to the style options.
mapDisambData :: (Output -> Output) -> CiteData -> CiteDataSource
mapCitationGroup :: ([Output] -> [Output]) -> CitationGroup -> CitationGroupSource
disambAddNames :: [CiteData] -> [CiteData]Source
disambAddLast :: [CiteData] -> [CiteData]Source
disambAddGivenNames :: [NameData] -> [NameData]Source
updateOutput :: [CiteData] -> [NameData] -> Output -> OutputSource
Given the list of CiteData with the disambiguated field set update the evaluated citations by setting the contributor list accordingly.
reEvaluate :: Style -> [CiteData] -> [(Cite, Reference)] -> CitationGroup -> CitationGroupSource
Evaluate again a citation group with the EvalState disamb field set to True (for matching the "disambiguate" condition).
hasIfDis :: IfThen -> [Bool]Source
Check if the Style has any conditional for disambiguation. In this case the conditional will be try after all other disambiguation strategies have failed. To be used with the generic query function.
getCitDisambOptions :: Style -> [String]Source
Get the list of disambiguation options set in the Style for citations.
getDuplCiteData :: Bool -> [CitationGroup] -> [[CiteData]]Source
Group citation data (with possible alternative names) of citations which have a duplicate (same collision and same citYear). If the first Bool is False, then we need to retrieve data for year suffix disambiguation.
getCiteData :: Output -> [CiteData]Source
For an evaluated citation get its CiteData. The disambiguated citation and the year fields are empty.
type NamesYear = ([Output], String)Source
The contributors diambiguation data, the list of names and give-names, and the citation year (OYear).
getDuplNamesYear :: Bool -> [CitationGroup] -> [NamesYear]Source
Get the contributors list (OContrib) and the year occurring in more then one citation.
getNamesYear :: Bool -> Output -> [(String, NamesYear)]Source
Get the list of citation keys coupled with their NamesYear in the evaluated Output. If the Bool is False then the function retrieves the names used in citations not occuring for the first time.
getYears :: Output -> [(String, String)]Source
getDuplNameData :: [CitationGroup] -> [[NameData]]Source
getDuplNames :: [CitationGroup] -> [[Output]]Source
getName :: Output -> [NameData]Source
generateYearSuffix :: [Reference] -> [(String, [Output])] -> [(String, String)]Source
setYearSuffCollision :: Bool -> [CiteData] -> [Output] -> [Output]Source
updateYearSuffixes :: [(String, String)] -> Output -> OutputSource
getYearSuffixes :: Output -> [(String, [Output])]Source
rmYearSuff :: [CitationGroup] -> [CitationGroup]Source
disambiguate :: Eq a => [[a]] -> [[a]]Source

Try to disambiguate a list of lists by returning the first non colliding element, if any, of each list:

 disambiguate [[1,2],[1,3],[2]] = [[2],[3],[2]]
same :: Eq a => [a] -> [Bool]Source

For each element a list of Bool: True if the element has a duplicate in the list:

 same [1,2,1] = [True,False,True]
hasDuplicates :: Eq a => [a] -> BoolSource
allTheSame :: Eq a => [a] -> BoolSource
Produced by Haddock version 2.6.1