Skip to content

Commit d4d4b47

Browse files
Merge pull request #4025 from JacquesCarette/whatAreJustTerms
Add new database dump file: things that are _just_ terms.
2 parents 358bb47 + c25fba0 commit d4d4b47

File tree

1 file changed

+4
-2
lines changed
  • code/drasil-gen/lib/Language/Drasil

1 file changed

+4
-2
lines changed

code/drasil-gen/lib/Language/Drasil/Dump.hs

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import qualified Data.ByteString.Lazy.Char8 as LB
1212
import qualified Data.Map.Strict as SM
1313

1414
import Utils.Drasil (invert, atLeast2)
15-
import Database.Drasil (traceTable, refbyTable)
15+
import Database.Drasil (traceTable, refbyTable, ChunkDB (termTable))
1616
import Control.Lens ((^.))
1717
import System.Environment (lookupEnv)
1818

@@ -39,12 +39,14 @@ dumpEverything0 si pinfo targetPath = do
3939
let chunkDb = si ^. sysinfodb
4040
chunkDump = DB.dumpChunkDB chunkDb
4141
invertedChunkDump = invert chunkDump
42-
sharedUIDs = SM.filter atLeast2 invertedChunkDump
42+
(sharedUIDs, nonsharedUIDs) = SM.partition atLeast2 invertedChunkDump
4343
traceDump = chunkDb ^. traceTable
4444
refByDump = chunkDb ^. refbyTable
45+
justTerms = SM.intersection nonsharedUIDs $ termTable chunkDb
4546

4647
dumpTo chunkDump $ targetPath ++ "seeds.json"
4748
dumpTo invertedChunkDump $ targetPath ++ "inverted_seeds.json"
49+
dumpTo justTerms $ targetPath ++ "uids_are_just_terms.json"
4850
dumpTo sharedUIDs $ targetPath ++ "problematic_seeds.json"
4951
dumpTo traceDump $ targetPath ++ "trace.json"
5052
dumpTo refByDump $ targetPath ++ "reverse_trace.json"

0 commit comments

Comments
 (0)