Skip to content

Commit

Permalink
Update spanish-transforms.js
Browse files Browse the repository at this point in the history
* Update spanish-transforms.js

Add subjunctive stem-changing verbs, more imperative forms and irregular gerund forms

Signed-off-by: Olga <[email protected]>

* Update spanish-transforms.js

spelling errors

Signed-off-by: Olga <[email protected]>

---------

Signed-off-by: Olga <[email protected]>

<rikaitan.link>YzllYzhlNmU1YjdmZDhlMDdmNTg5MjVjYjJjZDFiZGMyOTM2YTQ5NAo=</rikaitan.link>
  • Loading branch information
jason-ojisan committed Dec 3, 2024
1 parent 3be032d commit 617707a
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion ext/js/language/es/spanish-transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ export const spanishTransforms = {
description: 'feminine form of an adjective',
rules: [
suffixInflection('a', 'o', ['adj'], ['adj']),
suffixInflection('a', '', ['adj'], ['adj']), // encantadora -> encantador, española -> español
...[...'aeio'].map((v) => suffixInflection(`${v}na`, `${addAccent(v)}n`, ['adj'], ['adj'])), // dormilona -> dormilón, chiquitina -> chiquitín
...[...'aeio'].map((v) => suffixInflection(`${v}sa`, `${addAccent(v)}s`, ['adj'], ['adj'])), // francesa -> francés
],
},
'present indicative': {
Expand Down Expand Up @@ -338,9 +341,18 @@ export const spanishTransforms = {
name: 'progressive',
description: 'Progressive form of a verb',
rules: [
// regular
suffixInflection('ando', 'ar', ['v_ar'], ['v_ar']),
suffixInflection('iendo', 'er', ['v_er'], ['v_er']),
suffixInflection('iendo', 'ir', ['v_ir'], ['v_ir']),
// vowel before the ending (-yendo)
suffixInflection('ayendo', 'aer', ['v_er'], ['v_er']), // traer -> trayendo, caer -> cayendo
suffixInflection('eyendo', 'eer', ['v_er'], ['v_er']), // leer -> leyendo
suffixInflection('uyendo', 'uir', ['v_ir'], ['v_ir']), // huir -> huyendo
// irregular
wholeWordInflection('oyendo', 'oír', ['v'], ['v']),
wholeWordInflection('yendo', 'ir', ['v'], ['v']),
// TODO stem-changing verbs
],
},
'imperative': {
Expand All @@ -349,12 +361,15 @@ export const spanishTransforms = {
rules: [
// -ar verbs
suffixInflection('a', 'ar', ['v_ar'], ['v_ar']),
suffixInflection('emos', 'ar', ['v_ar'], ['v_ar']),
suffixInflection('ad', 'ar', ['v_ar'], ['v_ar']),
// -er verbs
suffixInflection('e', 'er', ['v_er'], ['v_er']),
suffixInflection('amos', 'ar', ['v_er'], ['v_er']),
suffixInflection('ed', 'er', ['v_er'], ['v_er']),
// -ir verbs
suffixInflection('e', 'ir', ['v_ir'], ['v_ir']),
suffixInflection('amos', 'ar', ['v_ir'], ['v_ir']),
suffixInflection('id', 'ir', ['v_ir'], ['v_ir']),
// irregular verbs
wholeWordInflection('diga', 'decir', ['v'], ['v']),
Expand All @@ -367,7 +382,19 @@ export const spanishTransforms = {
wholeWordInflection('di', 'decir', ['v'], ['v']),
wholeWordInflection('pon', 'poner', ['v'], ['v']),
wholeWordInflection('sal', 'salir', ['v'], ['v']),
// TODO: negative commands, nosotros & vosotros commands
// negative commands
// -ar verbs
suffixInflection('es', 'ar', ['v_ar'], ['v_ar']),
suffixInflection('emos', 'ar', ['v_ar'], ['v_ar']),
suffixInflection('éis', 'ar', ['v_ar'], ['v_ar']),
// -er verbs
suffixInflection('as', 'er', ['v_er'], ['v_er']),
suffixInflection('amos', 'er', ['v_er'], ['v_er']),
suffixInflection('áis', 'er', ['v_er'], ['v_er']),
// -ir verbs
suffixInflection('as', 'ir', ['v_ir'], ['v_ir']),
suffixInflection('amos', 'ir', ['v_ir'], ['v_ir']),
suffixInflection('áis', 'ir', ['v_ir'], ['v_ir']),
],
},
'conditional': {
Expand Down

0 comments on commit 617707a

Please sign in to comment.