1.0.1 • Published 5 years ago

@ma.vu/which-article v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Install

npm install @ma.vu/which-article

What is this

Mini library to determine what word has which German article based on rules for der/das/die.

Currently it determine article based on Seasons, Days, Month, and word endings.

When word is a Day

const whichArticle = require('@ma.vu/which-article')
whichArticle('Freitag') 
/*
  { gender: 'der', msg: 'day_month' }
*/

When word ends with endings typical for das articles

const whichArticle = require('@ma.vu/which-article')
whichArticle('Mädchen') 
/*
  { gender: 'das', msg: 'endings', endings: ['chen', 'lein', 'ment', 'tum', 'ma', 'um'] }
*/

When word can't be determined

const whichArticle = require('@ma.vu/which-article')
whichArticle('Brief')
/*
  null
*/