spanish-adjectives
TypeScript icon, indicating that this package has built-in type declarations

3.3.0 • Public • Published

spanish-adjectives

Agreement of Spanish adjectives, based on the gender and number.

Manages a lot of special cases:

  • extensive list of nationalities: francés becomes francesas FP
  • invariable: esmeralda, macho
  • exceptions: joven becomes jóvenes MP
  • apocopes (bueno becomes buen when placed before a M S word)

Installation

npm install spanish-adjectives

Usage

const SpanishAdjectives = require('spanish-adjectives');

// negras
console.log(SpanishAdjectives.agreeAdjective('negro', 'F', 'P'));

// daneses
console.log(SpanishAdjectives.agreeAdjective('danés', 'M', 'P'));

One main function agreeAdjective that takes multiple parameters and return the agreed adjective:

  • adjective: the adjective to agree; it must be the lemma, not the agreed form
  • gender gender of the word; M F
  • number: number of the word; S or P
  • precedesNoun: put true if the adjective will precede the noun; default false; used for apocopes

Readme

Keywords

Package Sidebar

Install

npm i spanish-adjectives

Weekly Downloads

245

Version

3.3.0

License

Apache-2.0

Unpacked Size

33.2 kB

Total Files

12

Last publish

Collaborators

  • ludan.stoeckle