machinatrix
A very silly Matrix bot written in C
|
Functions to process and navigate Wiktionary pages. More...
#include <stdbool.h>
#include "common.h"
#include <tidy.h>
Go to the source code of this file.
Data Structures | |
struct | wikt_page |
Relevant elements of a page. More... | |
Macros | |
#define | WIKTIONARY_BASE "https://en.wiktionary.org/wiki" |
Base URL for the service. | |
Functions | |
bool | wikt_parse_page (TidyDoc doc, wikt_page *p) |
Finds the page elements. | |
TidyNode | wikt_translation_head (TidyNode node) |
Finds the header of a translation element. | |
TidyNode | wikt_translation_body (TidyNode node) |
Finds the body of a translation element. | |
bool | wikt_next_section (const char *cls, const char *prefix, TidyNode *node) |
Advances node until the next section. | |
bool | wikt_next_subsection (const char *cls, const char *prefix, TidyNode *node) |
Advances node until the next subsection. | |
Functions to process and navigate Wiktionary pages.
#define WIKTIONARY_BASE "https://en.wiktionary.org/wiki" |
Base URL for the service.
bool wikt_next_section | ( | const char * | cls, |
const char * | prefix, | ||
TidyNode * | node ) |
Advances node
until the next section.
bool wikt_next_subsection | ( | const char * | cls, |
const char * | prefix, | ||
TidyNode * | node ) |
Advances node
until the next subsection.
bool wikt_parse_page | ( | TidyDoc | doc, |
wikt_page * | p ) |
Finds the page elements.
doc | The root document. |
p | Output parameter. |
TidyNode wikt_translation_body | ( | TidyNode | node | ) |
Finds the body of a translation element.
TidyNode wikt_translation_head | ( | TidyNode | node | ) |
Finds the header of a translation element.