machinatrix
A very silly Matrix bot written in C
Loading...
Searching...
No Matches
wikt.h File Reference

Functions to process and navigate Wiktionary pages. More...

#include <stdbool.h>
#include "common.h"
#include <tidy.h>
Include dependency graph for wikt.h:
This graph shows which files directly or indirectly include this file:

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.
 

Detailed Description

Functions to process and navigate Wiktionary pages.

https://www.wiktionary.org

Macro Definition Documentation

◆ WIKTIONARY_BASE

#define WIKTIONARY_BASE   "https://en.wiktionary.org/wiki"

Base URL for the service.

Function Documentation

◆ wikt_next_section()

bool wikt_next_section ( const char * cls,
const char * prefix,
TidyNode * node )

Advances node until the next section.

Returns
Whether a section was found.

◆ wikt_next_subsection()

bool wikt_next_subsection ( const char * cls,
const char * prefix,
TidyNode * node )

Advances node until the next subsection.

Returns
Whether a subsection was found.

◆ wikt_parse_page()

bool wikt_parse_page ( TidyDoc doc,
wikt_page * p )

Finds the page elements.

Parameters
docThe root document.
pOutput parameter.

◆ wikt_translation_body()

TidyNode wikt_translation_body ( TidyNode node)

Finds the body of a translation element.

◆ wikt_translation_head()

TidyNode wikt_translation_head ( TidyNode node)

Finds the header of a translation element.