SwuduSusuwu / SubStack

Stages blog posts, has C++ sources which match posts. Blog is about antivirus + autonomous tools + human nervous tissues
https://SwuduSusuwu.substack.com/
Apache License 2.0
1 stars 0 forks source link

`cxx/AssistantCns.hxx` has unfinished formulas (to produce+process databases of resources.) Do this as `cxx/ClassCns.hxx` or (new) `cxx/ClassDatabases.hxx` #9

Open SwuduSusuwu opened 5 months ago

SwuduSusuwu commented 5 months ago

Lots of this has general purpose uses, such as to do https://github.com/SwuduSusuwu/SubStack/blob/trunk/posts/CnsCompress.md

cxx/AssistantCns.hxx#L22

static std::vector<FilePath> assistantDefaultHosts = {
/* Universal Resources Locators of hosts which `questionsResponsesFromHosts()` uses
 * Wikipedia is a special case; has compressed downloads of databases ( https://wikipedia.org/wiki/Wikipedia:Database_download )
 * Github is a special case; has compressed downloads of repositories ( https://docs.github.com/en/get-started/start-your-journey/downloading-files-from-github )
 */
    "https://stackoverflow.com",
    "https://superuser.com",
    "https://quora.com"
};

/* @throw std::bad_alloc
 * @post If no question, `0 == questionsOrNull.bytecodes[x].size()` (new message synthesis).
 * If no responses, `0 == responsesOrNull.bytecodes[x].size()` (ignore).
 * `questionsOrNull.signatures[x] = Universal Resource Locator`
 * @code Sha2(ResultList.bytecodes[x]) == ResultList.hashes[x] @endcode */
void questionsResponsesFromHosts(ResultList &questionsOrNull, ResultList &responsesOrNull, const std::vector<FilePath> &hosts = assistantDefaultHosts);
void questionsResponsesFromXhtml(ResultList &questionsOrNull, ResultList &responsesOrNull, const FilePath &filepath = "index.xhtml");
const std::vector<FilePath> assistantParseUrls(const FilePath &filepath = "index.xhtml"); /* TODO: for XML/XHTML could just use [ https://www.boost.io/libraries/regex/ https://github.com/boostorg/regex ] or [ https://www.boost.org/doc/libs/1_85_0/doc/html/property_tree/parsers.html#property_tree.parsers.xml_parser https://github.com/boostorg/property_tree/blob/develop/doc/xml_parser.qbk ] */
const FileBytecode assistantParseQuestion(const FilePath &filepath = "index.xhtml"); /* TODO: regex or XML parser */
const std::vector<FileBytecode> assistantParseResponses(const FilePath &filepath = "index.xhtml"); /* TODO: regex or XML parser */
SwuduSusuwu commented 1 month ago

?questionsResponsesFromXhtml() "shadows outer" fix@6596f60 is an insignificant update, but has to do with this