File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ async function main() {
312312 console . log ( "setup snippets and references done\n" ) ;
313313
314314 await recursiveXmlToHtmlInOrder ( "parseXml" ) ;
315- writeRewritedSearchData ( ) ;
315+ writeRewritedSearchData ( outputDir ) ;
316316 // this is meant to be temp; also, will remove the original "generateSearchData" after the updation at the frontend is completed.
317317 //testIndexSearch();
318318 }
Original file line number Diff line number Diff line change 11import fs from "node:fs" ;
2+ import path from "node:path" ;
23import { insert , TrieNode } from "./search/TrieNode.js" ;
34
45// line 3 to 68: trie implementation and search functions
@@ -250,12 +251,12 @@ const buildTextTrie = () => {
250251 }
251252} ;
252253
253- export const writeRewritedSearchData = ( ) => {
254+ export const writeRewritedSearchData = ( outputDir : string ) => {
254255 buildTextTrie ( ) ;
255256
256257 const searchData = { indexTrie, textTrie, idToContentMap } ;
257258 fs . writeFile (
258- "json/ rewritedSearchData.json",
259+ path . join ( outputDir , " rewritedSearchData.json") ,
259260 JSON . stringify ( searchData ) ,
260261 err => {
261262 if ( err ) {
You can’t perform that action at this time.
0 commit comments