module Drasil.Projectile.Concepts (
launcher, projectile, target, projMotion, defs, rectVel, ideaDicts,
flightDur, offset, landPos, launAngle, launSpeed, targPos, projSpeed, projPos
) where
import Drasil.Database (mkUid)
import Control.Lens ((^.))
import Language.Drasil
import Language.Drasil.Chunk.Concept.NamedCombinators
import qualified Language.Drasil.Development as D
import qualified Language.Drasil.Sentence.Combinators as S
import Data.Drasil.Concepts.Documentation (constant)
import Data.Drasil.Concepts.Math (angle)
import Data.Drasil.Concepts.Physics (oneD, position, speed, motion, distance, iSpeed, time,
rectilinear, velocity, acceleration)
ideaDicts :: [IdeaDict]
ideaDicts :: [IdeaDict]
ideaDicts = [IdeaDict
projMotion, IdeaDict
launch, IdeaDict
rectVel]
launch :: IdeaDict
launch :: IdeaDict
launch = UID -> NP -> IdeaDict
idea' (String -> UID
mkUid String
"launch") (String -> NP
nounPhraseSP String
"launch")
rectVel :: IdeaDict
rectVel :: IdeaDict
rectVel = ConceptChunk -> ConceptChunk -> IdeaDict
forall a b. (NamedIdea a, NamedIdea b) => a -> b -> IdeaDict
compoundNC ConceptChunk
rectilinear ConceptChunk
velocity
projMotion :: IdeaDict
projMotion :: IdeaDict
projMotion = ConceptChunk -> ConceptChunk -> IdeaDict
forall a b. (NamedIdea a, NamedIdea b) => a -> b -> IdeaDict
compoundNC ConceptChunk
projectile ConceptChunk
motion
defs :: [ConceptChunk]
defs :: [ConceptChunk]
defs = [ConceptChunk
launcher, ConceptChunk
projectile, ConceptChunk
target]
launcher, projectile, target, projSpeed, projPos, landPos, launAngle, launSpeed,
offset, targPos, flightDur :: ConceptChunk
launcher :: ConceptChunk
launcher = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"launcher") (String -> NP
nounPhraseSP String
"launcher")
(String -> Sentence
S String
"where the projectile is launched from and the device that does the launching")
projectile :: ConceptChunk
projectile = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"projectile") (String -> NP
nounPhraseSP String
"projectile")
(String -> Sentence
S String
"the object to be launched at the target")
target :: ConceptChunk
target = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"target") (String -> NP
nounPhraseSP String
"target")
(String -> Sentence
S String
"where the projectile should be launched to")
projSpeed :: ConceptChunk
projSpeed = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"projSpeed") (String -> NP
nounPhraseSP String
"1D speed")
(CI -> Sentence
forall c. Idea c => c -> Sentence
short CI
oneD Sentence -> Sentence -> Sentence
+:+ ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
speed Sentence -> Sentence -> Sentence
+:+ String -> Sentence
S String
"under" Sentence -> Sentence -> Sentence
+:+ IdeaDict -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
constant Sentence -> Sentence -> Sentence
+:+ ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
acceleration)
projPos :: ConceptChunk
projPos = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"projPos") (String -> NP
nounPhraseSP String
"1D position")
(CI -> Sentence
forall c. Idea c => c -> Sentence
short CI
oneD Sentence -> Sentence -> Sentence
+:+ ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
position Sentence -> Sentence -> Sentence
+:+ String -> Sentence
S String
"under" Sentence -> Sentence -> Sentence
+:+ IdeaDict -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
constant Sentence -> Sentence -> Sentence
+:+ ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
speed)
landPos :: ConceptChunk
landPos = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"landingposition") (NP -> NP -> NP
forall a b. (NounPhrase a, NounPhrase b) => a -> b -> NP
compoundPhrase (String -> NP
nounPhraseSP String
"landing") (ConceptChunk
position ConceptChunk -> Getting NP ConceptChunk NP -> NP
forall s a. s -> Getting a s a -> a
^. Getting NP ConceptChunk NP
forall c. NamedIdea c => Lens' c NP
Lens' ConceptChunk NP
term))
([Sentence] -> Sentence
foldlSent_ [NPStruct -> Sentence
D.toSent (NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP (ConceptChunk -> NP
forall t. NamedIdea t => t -> NP
the ConceptChunk
distance)) Sentence -> Sentence -> Sentence
`S.fromThe` ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
launcher
Sentence -> Sentence -> Sentence
`S.toThe` String -> Sentence
S String
"final", NPStruct -> Sentence
D.toSent (NPStruct -> Sentence) -> NPStruct -> Sentence
forall a b. (a -> b) -> a -> b
$ NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP (ConceptChunk
position ConceptChunk -> ConceptChunk -> NP
forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`ofThe` ConceptChunk
projectile)])
launAngle :: ConceptChunk
launAngle = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"launchangle") (NP -> NP -> NP
forall a b. (NounPhrase a, NounPhrase b) => a -> b -> NP
compoundPhrase (IdeaDict
launch IdeaDict -> Getting NP IdeaDict NP -> NP
forall s a. s -> Getting a s a -> a
^. Getting NP IdeaDict NP
forall c. NamedIdea c => Lens' c NP
Lens' IdeaDict NP
term) (ConceptChunk
angle ConceptChunk -> Getting NP ConceptChunk NP -> NP
forall s a. s -> Getting a s a -> a
^. Getting NP ConceptChunk NP
forall c. NamedIdea c => Lens' c NP
Lens' ConceptChunk NP
term))
([Sentence] -> Sentence
foldlSent_ [NPStruct -> Sentence
D.toSent (NPStruct -> Sentence) -> NPStruct -> Sentence
forall a b. (a -> b) -> a -> b
$ NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP (ConceptChunk -> NP
forall t. NamedIdea t => t -> NP
the ConceptChunk
angle), String -> Sentence
S String
"between the", ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
launcher
Sentence -> Sentence -> Sentence
`S.and_` String -> Sentence
S String
"a straight line" Sentence -> Sentence -> Sentence
`S.fromThe` NPStruct -> Sentence
D.toSent (NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP (ConceptChunk
launcher ConceptChunk -> ConceptChunk -> NP
forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`toThe` ConceptChunk
target))])
launSpeed :: ConceptChunk
launSpeed = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"launchspeed") (NP -> NP -> NP
forall a b. (NounPhrase a, NounPhrase b) => a -> b -> NP
compoundPhrase (IdeaDict
launch IdeaDict -> Getting NP IdeaDict NP -> NP
forall s a. s -> Getting a s a -> a
^. Getting NP IdeaDict NP
forall c. NamedIdea c => Lens' c NP
Lens' IdeaDict NP
term) (ConceptChunk
speed ConceptChunk -> Getting NP ConceptChunk NP -> NP
forall s a. s -> Getting a s a -> a
^. Getting NP ConceptChunk NP
forall c. NamedIdea c => Lens' c NP
Lens' ConceptChunk NP
term))
(NPStruct -> Sentence
D.toSent (NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP (ConceptChunk
iSpeed ConceptChunk -> ConceptChunk -> NP
forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`the_ofThe` ConceptChunk
projectile)) Sentence -> Sentence -> Sentence
+:+ String -> Sentence
S String
"when launched")
offset :: ConceptChunk
offset = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"offset") (NP -> NP -> NP
forall a b. (NounPhrase a, NounPhrase b) => a -> b -> NP
compoundPhrase (String -> NP
cn String
"distance between the") (ConceptChunk
targPos ConceptChunk -> ConceptChunk -> NP
forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`andThe` ConceptChunk
landPos))
(String -> Sentence
S String
"the offset between the" Sentence -> Sentence -> Sentence
+:+ NPStruct -> Sentence
D.toSent (NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP (ConceptChunk
targPos ConceptChunk -> ConceptChunk -> NP
forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`andThe` ConceptChunk
landPos)))
targPos :: ConceptChunk
targPos = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"targetposition") (NP -> NP -> NP
forall a b. (NounPhrase a, NounPhrase b) => a -> b -> NP
compoundPhrase (ConceptChunk
target ConceptChunk -> Getting NP ConceptChunk NP -> NP
forall s a. s -> Getting a s a -> a
^. Getting NP ConceptChunk NP
forall c. NamedIdea c => Lens' c NP
Lens' ConceptChunk NP
term) (ConceptChunk
position ConceptChunk -> Getting NP ConceptChunk NP -> NP
forall s a. s -> Getting a s a -> a
^. Getting NP ConceptChunk NP
forall c. NamedIdea c => Lens' c NP
Lens' ConceptChunk NP
term))
(NPStruct -> Sentence
D.toSent (NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP (ConceptChunk -> NP
forall t. NamedIdea t => t -> NP
the ConceptChunk
distance)) Sentence -> Sentence -> Sentence
`S.fromThe` NPStruct -> Sentence
D.toSent (NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP (ConceptChunk
launcher ConceptChunk -> ConceptChunk -> NP
forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`toThe` ConceptChunk
target)))
flightDur :: ConceptChunk
flightDur = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"flightduration") (NP -> NP -> NP
forall a b. (NounPhrase a, NounPhrase b) => a -> b -> NP
compoundPhrase (String -> NP
nounPhraseSP String
"flight") (String -> NP
nounPhraseSP String
"duration"))
([Sentence] -> Sentence
foldlSent_ [NPStruct -> Sentence
D.toSent (NPStruct -> Sentence) -> NPStruct -> Sentence
forall a b. (a -> b) -> a -> b
$ NP -> NPStruct
forall n. NounPhrase n => n -> NPStruct
phraseNP (ConceptChunk -> NP
forall t. NamedIdea t => t -> NP
the ConceptChunk
time), String -> Sentence
S String
"when the", ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
projectile, String -> Sentence
S String
"lands"])