drasil-printers-0.1.10.0: A framework for code and document generation for scientific software - Printers SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.Printing.Import.Helpers

Description

Printing helpers.

Synopsis

Expr-related

parens :: Expr -> Expr Source #

Helper for inserting parentheses.

digitsProcess :: [Integer] -> Int -> Int -> Integer -> [Expr] Source #

Processes the digits from the floatToDigits function, decimal point position, a counter, and exponent.

processExpo :: Int -> (Int, Int) Source #

Takes the exponent and the Int of the base and gives the decimal point position and processed exponent. This function supports transferring scientific notation to engineering notation. References for standard of Engineering Notation:

https://www.khanacademy.org/science/electrical-engineering/introduction-to-ee/ intro-to-eeaee-numbers-in-electrical-engineering

https://www.calculatorsoup.com/calculators/math/scientific-notation-converter.php

https://en.wikipedia.org/wiki/Scientific_notation

Lookup/Term Resolution Functions

lookupC :: Stage -> ChunkDB -> UID -> Symbol Source #

Given the stage of the symbol, looks up a character/symbol inside a chunk database that matches the given UID.

lookupT :: ChunkDB -> UID -> TermCapitalization -> Sentence Source #

Look up a term given a chunk database and a UID associated with the term. Also specifies capitalization

lookupS :: ChunkDB -> UID -> TermCapitalization -> Sentence Source #

Look up the acronym/abbreviation of a term. Otherwise returns the singular form of a term. Takes a chunk database and a UID associated with the term.

lookupP :: ChunkDB -> UID -> TermCapitalization -> Sentence Source #

Look up the plural form of a term given a chunk database and a UID associated with the term.

resolveCapT :: TermCapitalization -> NP -> Sentence Source #

Helper to get the proper function for capitalizing a NP based on its TermCapitalization. Singular case.

resolveCapP :: TermCapitalization -> NP -> Sentence Source #

Helper to get the right function for capitalizing a NP based on its TermCapitalization. Plural case.

capHelper :: TermCapitalization -> String -> Maybe String Source #

Helper to get the capital case of an abbreviation based on TermCapitalization. For sentence and title cases.