parse-wiktionary
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Wiktionary Parser

A Typescript clone of the original WiktionaryParser that downloads words from Wiktionary (wiktionary.org) and parses them in an easy to use JSON format. Right now, it parses etymologies, definitions, pronunciations, examples, audio links and related words.

JSON structure

[{
    "pronunciations": {
        "text": ["pronunciation text"],
        "audio": ["pronunciation audio"]
    },
    "definitions": [{
        "relatedWords": [{
            "relationshipType": "word relationship type",
            "words": ["list of related words"]
        }],
        "text": ["list of definitions"],
        "partOfSpeech": "part of speech",
        "examples": ["list of examples"]
    }],
    "etymology": "etymology text",
}]

Installation

npm install parse-wiktionary

Usage

  • Import the WiktionaryParser class.
  • Initialize an object and use the parse("word", "language") method.

Examples

const { WiktionaryParser } = require('parse-wiktionary');

const parser = new WiktionaryParser();
const englishResults = parser.parse('test');
const frenchResults = parser.parse('test', 'french');

Contributions

If you want to add features/improvement or report issues, feel free to send a pull request!

License

Wiktionary Parser is licensed under MIT.

/parse-wiktionary/

    Package Sidebar

    Install

    npm i parse-wiktionary

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    24.4 kB

    Total Files

    19

    Last publish

    Collaborators

    • onsa