string - How does text processing works? -
consider whole novel (e.g. da vinci code).
how e-book reader software process , output whole book??
does put whole book in 1 large string?? array of strings?? or what??
one of first "real" programs wrote (as part of class excersise in high school) text editor. part of requirement excersise program able handle documents of arbitrary length (ie larger available system memory).
we achieved opening file, reading portion of required display current page of data. when user moves forward or backward in file, read portion of file , display it.
we can speed program reading ahead load pages anticipate user want, , retaining read pages in memory there no obvious delay when user moves forward or backward.
so basically, answer question is: "no. large text files, unusual load whole thing memory @ once. program can handle files load in chunks needs to, , drop chunks doesn't need more."
complex document formats (such ebooks) may have lookup tables built file allow user search or jump given page or chapter. in this, work database.
i hope helps.
Comments
Post a Comment