{-# OPTIONS_GHC -Wno-redundant-constraints #-}
module Language.Drasil.Development.Sentence (
phrase, plural, phrasePoss, pluralPoss,
atStart, atStart',
titleize, titleize',
short, introduceAbb) where
import Control.Lens ((^.))
import Language.Drasil.Classes (NamedIdea(term), Idea)
import Language.Drasil.Sentence ((+:+), Sentence((:+:), S), sParen, sentenceTerm,
sentencePlural, sentenceShort)
import qualified Language.Drasil.NounPhrase as NP
import Language.Drasil.UID (HasUID(..))
short :: (Idea c, HasUID c) => c -> Sentence
short :: c -> Sentence
short c :: c
c = UID -> Sentence
sentenceShort (c
c c -> Getting UID c UID -> UID
forall s a. s -> Getting a s a -> a
^. Getting UID c UID
forall c. HasUID c => Lens' c UID
uid)
introduceAbb :: Idea n => n -> Sentence
introduceAbb :: n -> Sentence
introduceAbb n :: n
n = NP -> Sentence
forall n. NounPhrase n => n -> Sentence
NP.titleizeNP (n
n n -> Getting NP n NP -> NP
forall s a. s -> Getting a s a -> a
^. Getting NP n NP
forall c. NamedIdea c => Lens' c NP
term) Sentence -> Sentence -> Sentence
+:+ Sentence -> Sentence
sParen (n -> Sentence
forall c. (Idea c, HasUID c) => c -> Sentence
short n
n)
atStart, atStart' :: NamedIdea n => n -> Sentence
atStart :: n -> Sentence
atStart n :: n
n = NP -> Sentence
forall n. NounPhrase n => n -> Sentence
NP.atStartNP (n
n n -> Getting NP n NP -> NP
forall s a. s -> Getting a s a -> a
^. Getting NP n NP
forall c. NamedIdea c => Lens' c NP
term)
atStart' :: n -> Sentence
atStart' n :: n
n = NP -> Sentence
forall n. NounPhrase n => n -> Sentence
NP.atStartNP' (n
n n -> Getting NP n NP -> NP
forall s a. s -> Getting a s a -> a
^. Getting NP n NP
forall c. NamedIdea c => Lens' c NP
term)
titleize, titleize' :: NamedIdea n => n -> Sentence
titleize :: n -> Sentence
titleize n :: n
n = NP -> Sentence
forall n. NounPhrase n => n -> Sentence
NP.titleizeNP (n
n n -> Getting NP n NP -> NP
forall s a. s -> Getting a s a -> a
^. Getting NP n NP
forall c. NamedIdea c => Lens' c NP
term)
titleize' :: n -> Sentence
titleize' n :: n
n = NP -> Sentence
forall n. NounPhrase n => n -> Sentence
NP.titleizeNP' (n
n n -> Getting NP n NP -> NP
forall s a. s -> Getting a s a -> a
^. Getting NP n NP
forall c. NamedIdea c => Lens' c NP
term)
phrase :: (HasUID n, NamedIdea n) => n -> Sentence
phrase :: n -> Sentence
phrase n :: n
n = UID -> Sentence
sentenceTerm (n
n n -> Getting UID n UID -> UID
forall s a. s -> Getting a s a -> a
^. Getting UID n UID
forall c. HasUID c => Lens' c UID
uid)
plural :: (HasUID n, NamedIdea n) => n -> Sentence
plural :: n -> Sentence
plural n :: n
n = UID -> Sentence
sentencePlural (n
n n -> Getting UID n UID -> UID
forall s a. s -> Getting a s a -> a
^. Getting UID n UID
forall c. HasUID c => Lens' c UID
uid)
phrasePoss, pluralPoss :: NamedIdea n => n -> Sentence
phrasePoss :: n -> Sentence
phrasePoss a :: n
a = n -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
phrase n
a Sentence -> Sentence -> Sentence
:+: String -> Sentence
S "'s"
pluralPoss :: n -> Sentence
pluralPoss a :: n
a = n -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
plural n
a Sentence -> Sentence -> Sentence
:+: String -> Sentence
S "'"