module Language.Drasil.Chunk.Concept (
ConceptChunk, dcc, dccWDS, cc, cc', ccs, cw,
ConceptInstance, cic
) where
import Language.Drasil.Classes (Idea, Definition(defn), ConceptDomain(cdom), Concept)
import Language.Drasil.Chunk.Concept.Core (ConceptChunk(ConDict), ConceptInstance(ConInst))
import Language.Drasil.Sentence (Sentence(S))
import Language.Drasil.Chunk.NamedIdea(mkIdea,nw, nc)
import Language.Drasil.NounPhrase (NP, pn)
import Language.Drasil.ShortName (shortname')
import Language.Drasil.UID (HasUID(uid))
import Control.Lens ((^.))
dcc :: String -> NP -> String -> ConceptChunk
dcc :: String -> NP -> String -> ConceptChunk
dcc String
i NP
ter String
des = IdeaDict -> Sentence -> [UID] -> ConceptChunk
ConDict (String -> NP -> Maybe String -> IdeaDict
mkIdea String
i NP
ter forall a. Maybe a
Nothing) (String -> Sentence
S String
des) []
dccWDS :: String -> NP -> Sentence -> ConceptChunk
dccWDS :: String -> NP -> Sentence -> ConceptChunk
dccWDS String
i NP
t Sentence
d = IdeaDict -> Sentence -> [UID] -> ConceptChunk
ConDict (String -> NP -> Maybe String -> IdeaDict
mkIdea String
i NP
t forall a. Maybe a
Nothing) Sentence
d []
cc :: Idea c => c -> String -> ConceptChunk
cc :: forall c. Idea c => c -> String -> ConceptChunk
cc c
n String
d = IdeaDict -> Sentence -> [UID] -> ConceptChunk
ConDict (forall c. Idea c => c -> IdeaDict
nw c
n) (String -> Sentence
S String
d) []
cc' :: Idea c => c -> Sentence -> ConceptChunk
cc' :: forall c. Idea c => c -> Sentence -> ConceptChunk
cc' c
n Sentence
d = IdeaDict -> Sentence -> [UID] -> ConceptChunk
ConDict (forall c. Idea c => c -> IdeaDict
nw c
n) Sentence
d []
ccs :: (Idea c, Concept d) => c -> Sentence -> [d] -> ConceptChunk
ccs :: forall c d.
(Idea c, Concept d) =>
c -> Sentence -> [d] -> ConceptChunk
ccs c
n Sentence
d [d]
l = IdeaDict -> Sentence -> [UID] -> ConceptChunk
ConDict (forall c. Idea c => c -> IdeaDict
nw c
n) Sentence
d forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map (forall s a. s -> Getting a s a -> a
^. forall c. HasUID c => Lens' c UID
uid) [d]
l
cw :: Concept c => c -> ConceptChunk
cw :: forall c. Concept c => c -> ConceptChunk
cw c
c = IdeaDict -> Sentence -> [UID] -> ConceptChunk
ConDict (forall c. Idea c => c -> IdeaDict
nw c
c) (c
c forall s a. s -> Getting a s a -> a
^. forall c. Definition c => Lens' c Sentence
defn) (forall c. ConceptDomain c => c -> [UID]
cdom c
c)
cic :: Concept c => String -> Sentence -> String -> c -> ConceptInstance
cic :: forall c.
Concept c =>
String -> Sentence -> String -> c -> ConceptInstance
cic String
u Sentence
d String
sn c
dom = ConceptChunk -> String -> ShortName -> ConceptInstance
ConInst (forall c d.
(Idea c, Concept d) =>
c -> Sentence -> [d] -> ConceptChunk
ccs (String -> NP -> IdeaDict
nc String
u forall a b. (a -> b) -> a -> b
$ String -> NP
pn String
sn) Sentence
d [c
dom]) String
u forall a b. (a -> b) -> a -> b
$ Sentence -> ShortName
shortname' (String -> Sentence
S String
sn)