Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Printing helpers.
Synopsis
- parens :: Expr -> Expr
- digitsProcess :: [Integer] -> Int -> Int -> Integer -> [Expr]
- processExpo :: Int -> (Int, Int)
- lookupC :: Stage -> ChunkDB -> UID -> Symbol
- lookupT :: ChunkDB -> UID -> TermCapitalization -> Sentence
- lookupS :: ChunkDB -> UID -> TermCapitalization -> Sentence
- lookupP :: ChunkDB -> UID -> TermCapitalization -> Sentence
- resolveCapT :: TermCapitalization -> NP -> Sentence
- resolveCapP :: TermCapitalization -> NP -> Sentence
- capHelper :: TermCapitalization -> String -> Maybe String
Expr-related
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
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.