2.2.1 • Published 3 years ago

de-noun-parser v2.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

de-noun-parser

Parse Wikitext's de-noun template

npm version

Install

npm i de-noun-parser 

Or

yarn add de-noun-parser 

Usage

import parse from 'de-noun-parser';

const wikitext = '...';
const parsed = parse(wikitext);

Parse result

FieldTypeNote
genderstringm or f or n
pluralstringIf -en, the plural form should default to the word + -en
genetivestring | nullIf -s, the genetive form should default to the word + s. If null, the genetive form should default to the word itself
diminutivestring?The diminutive form of the noun, or undefined when not applicable
genderedFormstring?The feminine form of a masculine noun, the masculine form of a feminine noun, or undefined when not applicable
template{ text: string, arguments: string, startIndex: number, endIndex: number }The template's full text, its arguments and its start and end indexes within the provided wikitext

If the parsing is not successful, a subclass of ParsingError is thrown.

Demo

Try the demo here.

About de-noun template

Template:de-noun documentation

2.2.1

3 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

5 years ago

1.0.0

5 years ago