Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3252 Sentence Reworking (for the SWHS Example, Part 3) #3980

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/drasil-example/swhs/lib/Drasil/SWHS/Body.hs
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ propCorSolDeriv2 = unlbldExpr
propCorSolDeriv3 :: NamedIdea a => a -> UnitalChunk -> CI -> ConceptChunk -> Contents
propCorSolDeriv3 epcm en pcmat wa =
foldlSP_ [S "In addition, the", phrase epcm, S "should equal the",
phrase en, phrase input_, S "to the", short pcmat,
phrase en, phrase input_ `S.toThe` short pcmat,
S "from the" +:+. phrase wa, S "This can be expressed as"]

propCorSolDeriv4 :: Contents
Expand Down
4 changes: 2 additions & 2 deletions code/drasil-example/swhs/lib/Drasil/SWHS/GenDefs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ rocTempDerivInteg = [S "Integrating", refS consThermE, S "over a",
phrase vol, sParen (ch vol) `sC` S "we have"]

rocTempDerivGauss :: [Sentence]
rocTempDerivGauss = [S "Applying", titleize gaussDiv, S "to the first term over",
rocTempDerivGauss = [S "Applying", titleize gaussDiv `S.toThe` S "first term over",
(phrase surface +:+ ch surface `S.the_ofThe` phrase vol) `sC` S "with",
ch thFluxVect, S "as the", phrase thFluxVect, S "for the",
phrase surface `S.and_` ch uNormalVect, S "as a", phrase unit_,
Expand All @@ -121,7 +121,7 @@ rocTempDerivConsFlxSWHS :: Sentence
rocTempDerivConsFlxSWHS = foldlSent [S "The integral over the", phrase surface,
S "could be simplified because the thermal flux" `S.is` S "assumed constant over",
ch inSA `S.and_` ch outSA `S.and_` eS (exactDbl 0), S "on all other" +:+. plural surface,
S "Outward flux is considered positive"]
S "Outward flux" `S.is` S "considered positive"]

rocTempDerivDens :: [Sentence]
rocTempDerivDens = [S "Using the fact that", ch density :+: S "=" :+: ch mass :+:
Expand Down
4 changes: 2 additions & 2 deletions code/drasil-example/swhs/lib/Drasil/SWHS/IMods.hs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ balPCMNotes = map foldlSent [
----------------------------------------------
eBalanceOnPCMDeriv :: Derivation
eBalanceOnPCMDeriv = mkDerivName (phraseNP (the energy) +:+
S "balance on the PCM during sensible heating phase")
S "balance" `S.onThe` S "PCM during sensible heating phase")
(weave [eBalanceOnPCMDerivSentences, map eS eBalanceOnPCMDerivEqnsIM2]
++ [eBalanceOnPCMDerivDesc5, eBalanceOnPCMDerivDesc6, eBalanceOnPCMDerivDesc7])

Expand Down Expand Up @@ -364,4 +364,4 @@ instModIntro = foldlSent [atStartNP' (the goal), foldlList Comma List
refS heatEInWtr, S "can be solved once", refS eBalanceOnWtr +:+.
S "has been solved", atStartNP' (the solution) `S.of_` refS eBalanceOnPCM `S.and_`
refS heatEInPCM `S.are` S "also coupled" `sC` S "since the",
phrase tempPCM `S.andThe` phrase pcmE,S "depend on the", phrase phaseChange]
phrase tempPCM `S.andThe` phrase pcmE,S "depend" `S.onThe` phrase phaseChange]
10 changes: 5 additions & 5 deletions code/drasil-example/swhs/lib/Drasil/SWHS/TMods.hs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ sensHtEdesc = foldlSent [
atStart sensHeat :+: S "ing occurs as long as the material does not reach a",
phrase temp, S "where a", phrase phaseChange, (S "occurs" !.), atStartNP (a_ phaseChange),
S "occurs if" +:+. (eS (sy temp $= sy boilPt) `S.or_` eS (sy temp $= sy meltPt)),
S "If this is the case" `sC` S "refer to", refS latentHtE]
S "If this" `S.is` S "the case" `sC` S "refer to", refS latentHtE]

--How to have new lines in the description?
--Can't have relation and eqn chunks together since they are called in a list
Expand Down Expand Up @@ -156,7 +156,7 @@ latentHtENotes = map foldlSent [
[eS' latentHtEFD `S.isThe` phrase rOfChng `S.of_` ch latentHeat `S.wrt`
phrase time, ch tau],
[ch time `S.isThe` phrase time, S "elapsed" `sC` S "as long as the",
phrase phaseChange, S "is not complete"],
phrase phaseChange `S.is` S "not complete"],
[S "status" `S.the_ofTheC` phrase phaseChange, S "depends on the",
phrase meltFrac, sParen (S "from" +:+ refS ddMeltFrac)],
[atStart latentHeat :+: S "ing stops when all material has changed to the new phase"]]
Expand All @@ -183,9 +183,9 @@ nwtnCoolingExpr = sy htTransCoeff $* apply1 deltaT time
nwtnCoolingNotes :: [Sentence]
nwtnCoolingNotes = map foldlSent [
[atStart lawConvCooling +:+. S "describes convective cooling from a surface" +:
S "The law is stated as", S "the", phrase rate `S.of_` S "heat loss from a body" `S.is`
S "proportional to the difference in", plural temp, S "between the body and its surroundings"],
[ch htTransCoeff, S "is assumed to be independent" `S.of_` ch temp,
(S "The law" `S.is` S "stated as"), S "the", phrase rate `S.of_` S "heat loss from a body" `S.is`
S "proportional" `S.toThe` S "difference in", plural temp, S "between the body and its surroundings"],
[ch htTransCoeff `S.is` S "assumed to be independent" `S.of_` ch temp,
sParen (S "from" +:+ refS assumpHTCC)],
[E (defines (apply1 deltaT time) (apply1 temp time $- apply1 tempEnv time)) `S.isThe`
S "time-dependant thermal gradient between the environment and the object"]]