parse_wiktionary_de 0.1.0

Parse dictionary pages from the German language edition of Wiktionary into structured data
Documentation
// Copyright 2018 Fredrik Portström <https://portstrom.com>
// This is free software distributed under the terms specified in
// the file LICENSE at the top-level directory of this distribution.

/// Allocates and returns a configuration for Parse Wiki Text suitable for parsing the German language edition of Wiktionary.
///
/// The same configuration should be reused when parsing multiple articles for optimal performance.
pub fn create_configuration() -> ::parse_wiki_text::Configuration {
    ::parse_wiki_text::Configuration::new(&::parse_wiki_text::ConfigurationSource {
        category_namespaces: &["category", "kategorie"],
        extension_tags: &[
            "abschnitt",
            "categorytree",
            "ce",
            "charinsert",
            "chem",
            "dynamicpagelist",
            "gallery",
            "graph",
            "hiero",
            "imagemap",
            "indicator",
            "inputbox",
            "mapframe",
            "maplink",
            "math",
            "nowiki",
            "poem",
            "pre",
            "ref",
            "references",
            "score",
            "section",
            "source",
            "syntaxhighlight",
            "templatedata",
            "timeline",
        ],
        file_namespaces: &["bild", "datei", "file", "image"],
        link_trail: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzßäöü",
        magic_words: &[
            "ABSCHNITTE_NICHT_BEARBEITEN",
            "DISAMBIG",
            "FORCETOC",
            "HIDDENCAT",
            "INDEX",
            "INDEXIEREN",
            "INDIZIEREN",
            "INHALTSVERZEICHNIS",
            "INHALTSVERZEICHNIS_ERZWINGEN",
            "KEINEGALERIE",
            "KEINE_GALERIE",
            "KEINE_INHALTSKONVERTIERUNG",
            "KEINE_TITELKONVERTIERUNG",
            "KEININHALTSVERZEICHNIS",
            "KEIN_INDEX",
            "KEIN_INHALTSVERZEICHNIS",
            "KEIN_NEUER_ABSCHNITTSLINK",
            "KEIN_PLUS_LINK",
            "NEUER_ABSCHNITTSLINK",
            "NEWSECTIONLINK",
            "NICHT_INDEXIEREN",
            "NICHT_INDIZIEREN",
            "NOCC",
            "NOCOLLABORATIONHUBTOC",
            "NOCONTENTCONVERT",
            "NOEDITSECTION",
            "NOGALLERY",
            "NOGLOBAL",
            "NOINDEX",
            "NONEWSECTIONLINK",
            "NOTC",
            "NOTITLECONVERT",
            "NOTOC",
            "PERMANENTE_WEITERLEITUNG",
            "PLUS_LINK",
            "STATICREDIRECT",
            "TOC",
            "VERSTECKTE_KATEGORIE",
            "WARTUNGSKATEGORIE",
        ],
        protocols: &[
            "//",
            "bitcoin:",
            "ftp://",
            "ftps://",
            "geo:",
            "git://",
            "gopher://",
            "http://",
            "https://",
            "irc://",
            "ircs://",
            "magnet:",
            "mailto:",
            "mms://",
            "news:",
            "nntp://",
            "redis://",
            "sftp://",
            "sip:",
            "sips:",
            "sms:",
            "ssh://",
            "svn://",
            "tel:",
            "telnet://",
            "urn:",
            "worldwind://",
            "xmpp:",
        ],
        redirect_magic_words: &["REDIRECT", "WEITERLEITUNG"],
    })
}