UNPKG

@jirimracek/conjugate-esp

Version:

Spanish verb conjugator, castellano, voseo, canarias, formal

594 lines 22.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.volcar = exports.vaciar = exports.tropezar = exports.sacar = exports.rozar = exports.regar = exports.pagar = exports.jugar = exports.forzar = exports.estar = exports.errar = exports.enraizar = exports.desosar = exports.desdar = exports.dar = exports.contar = exports.colgar = exports.cabrahigar = exports.avergonzar = exports.aunar = exports.andar = exports.aislar = exports.ahincar = exports.aguar = exports.engorar = exports.actuar = exports.acertar = exports.hablar = void 0; const basemodel_1 = require("./basemodel"); const stringutils_1 = require("./stringutils"); const Array_6 = Array(6).fill(''); const caeIndicativoPreteritoIndefinido = (region) => { return ['uve', region !== 'formal' ? 'uviste' : 'uvo', 'uvo', 'uvimos', region !== 'castellano' ? 'uvieron' : 'uvisteis', 'uvieron']; }; const caeSubjuntivoPreteritoImperfectoRa = (region) => { return ['uviera', region !== 'formal' ? 'uvieras' : 'uviera', 'uviera', 'uviéramos', region !== 'castellano' ? 'uvieran' : 'uvierais', 'uvieran']; }; const caeSubjuntivoPreteritoImperfectoSe = (region) => { return caeSubjuntivoPreteritoImperfectoRa(region).map(d => d.replace('ra', 'se')); }; const caeSubjuntivoFuturoImperfecto = (region) => { return caeSubjuntivoPreteritoImperfectoRa(region).map(d => d.replace('ra', 're')); }; class hablar extends basemodel_1.BaseModel { constructor(verb, region, attributes) { super(verb, region, attributes); this.desinences = this.initDesinences(region); } initDesinences(region) { return { Impersonal: { Infinitivo: !this.reflexive ? 'ar' : 'arse', Gerundio: !this.reflexive ? 'ando' : 'ándose', Participio: 'ado' }, Indicativo: { Presente: ['o', region !== 'voseo' ? (region !== 'formal' ? 'as' : 'a') : 'ás', 'a', 'amos', region !== 'castellano' ? 'an' : 'áis', 'an' ], PreteritoImperfecto: ['aba', region !== 'formal' ? 'abas' : 'aba', 'aba', 'ábamos', region !== 'castellano' ? 'aban' : 'abais', 'aban' ], PreteritoIndefinido: ['é', region !== 'formal' ? 'aste' : 'ó', 'ó', 'amos', region !== 'castellano' ? 'aron' : 'asteis', 'aron' ], FuturoImperfecto: ['aré', region !== 'formal' ? 'arás' : 'ará', 'ará', 'aremos', region !== 'castellano' ? 'arán' : 'aréis', 'arán' ], CondicionalSimple: ['aría', region !== 'formal' ? 'arías' : 'aría', 'aría', 'aríamos', region !== 'castellano' ? 'arían' : 'aríais', 'arían'] }, Subjuntivo: { Presente: ['e', region !== 'formal' ? 'es' : 'e', 'e', 'emos', region !== 'castellano' ? 'en' : 'éis', 'en' ], PreteritoImperfectoRa: ['ara', region !== 'formal' ? 'aras' : 'ara', 'ara', 'áramos', region !== 'castellano' ? 'aran' : 'arais', 'aran' ], PreteritoImperfectoSe: ['ase', region !== 'formal' ? 'ases' : 'ase', 'ase', 'ásemos', region !== 'castellano' ? 'asen' : 'aseis', 'asen' ], FuturoImperfecto: ['are', region !== 'formal' ? 'ares' : 'are', 'are', 'áremos', region !== 'castellano' ? 'aren' : 'areis', 'aren' ] } }; } } exports.hablar = hablar; class acertar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = this.stem.replace(/(.*)e/, '$1ie'); } setParticipio() { super.setParticipio(); const PR = this.attributes['PR']; if (PR) { const [expression, alteredStem] = PR.split('/'); this.participioCompuesto = this.participioCompuesto.replace(expression, alteredStem); this.table.Impersonal.Participio = this.participioCompuesto; } } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.alteredStem, this.alteredStem); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.alteredStem); } } exports.acertar = acertar; class actuar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = this.stem.replace(/(.*)u/, '$1ú'); if (typeof this.attributes['M'] !== 'undefined' && this.attributes['M'] === 'true') { if (region === 'voseo') { this.desinences.Indicativo.Presente[1] = 'as'; } if (region === 'castellano') { this.desinences.Indicativo.Presente[4] = 'ais'; this.desinences.Subjuntivo.Presente[4] = 'eis'; } if (region === 'formal') { this.desinences.Indicativo.PreteritoIndefinido[1] = 'o'; } this.desinences.Indicativo.PreteritoIndefinido[0] = 'e'; this.desinences.Indicativo.PreteritoIndefinido[2] = 'o'; } } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.alteredStem, this.alteredStem); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.alteredStem); } } exports.actuar = actuar; class engorar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = this.stem.replace(/or$/, 'üer'); } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.alteredStem, this.alteredStem); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.alteredStem); } } exports.engorar = engorar; class aguar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = this.stem.replace(/u$/, 'ü'); } setIndicativoPreteritoIndefinido() { this.setIndicativoPreteritoIndefinidoPattern0(this.alteredStem); } setSubjuntivoPresente() { this.setTable('Subjuntivo', 'Presente', Array_6.map(() => this.alteredStem)); } } exports.aguar = aguar; class ahincar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.stem.replace(/i/, 'í'), this.stem.replace(/i/, 'í')); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.stem.replace(/inc/, 'ínqu'), this.stem.replace(/c/, 'qu')); } setIndicativoPreteritoIndefinido() { this.setIndicativoPreteritoIndefinidoPattern0(this.stem.replace(/c/, 'qu')); } } exports.ahincar = ahincar; class aislar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = this.stem.replace(/i/, 'í'); } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.alteredStem, this.alteredStem); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.alteredStem); } } exports.aislar = aislar; class andar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.desinences.Indicativo.PreteritoIndefinido = caeIndicativoPreteritoIndefinido(region); this.desinences.Subjuntivo.PreteritoImperfectoRa = caeSubjuntivoPreteritoImperfectoRa(region); this.desinences.Subjuntivo.PreteritoImperfectoSe = caeSubjuntivoPreteritoImperfectoSe(region); this.desinences.Subjuntivo.FuturoImperfecto = caeSubjuntivoFuturoImperfecto(region); } } exports.andar = andar; class aunar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = this.stem.replace(/u/, 'ú'); } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.alteredStem, this.alteredStem); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.alteredStem); } } exports.aunar = aunar; class avergonzar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = this.stem.replace(/o/, 'üe'); } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.alteredStem, this.alteredStem); } setIndicativoPreteritoIndefinido() { this.setIndicativoPreteritoIndefinidoPattern0(this.stem.replace(/z$/, 'c')); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.stem.replace(/onz/, 'üenc'), this.stem.replace(/z$/, 'c')); } } exports.avergonzar = avergonzar; class cabrahigar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = this.stem.replace(/i/, 'í'); this.desinences.Indicativo.PreteritoIndefinido[0] = `u${this.desinences.Indicativo.PreteritoIndefinido[0]}`; this.desinences.Subjuntivo.Presente = this.desinences.Subjuntivo.Presente.map(d => `u${d}`); } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.alteredStem, this.alteredStem); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.alteredStem); } } exports.cabrahigar = cabrahigar; class colgar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = this.stem.replace(/o/, 'ue'); this.desinences.Indicativo.PreteritoIndefinido[0] = `u${this.desinences.Indicativo.PreteritoIndefinido[0]}`; this.desinences.Subjuntivo.Presente = this.desinences.Subjuntivo.Presente.map(d => `u${d}`); } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.alteredStem, this.alteredStem); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.alteredStem); } } exports.colgar = colgar; class contar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = this.stem.replace(/(.*)o/, (match, p1) => { if (p1.endsWith('g')) { return `${p1}üe`; } return `${p1}ue`; }); } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.alteredStem, this.alteredStem); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.alteredStem); } } exports.contar = contar; class dar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.desinences.Indicativo.Presente = ['oy', region !== 'formal' ? 'as' : 'a', 'a', 'amos', region !== 'castellano' ? 'an' : 'ais', 'an' ]; this.desinences.Indicativo.PreteritoIndefinido = ['i', region !== 'formal' ? 'iste' : 'io', 'io', 'imos', region !== 'castellano' ? 'ieron' : 'isteis', 'ieron' ]; this.desinences.Subjuntivo.Presente = ['é', region !== 'formal' ? 'es' : 'é', 'é', 'emos', region !== 'castellano' ? 'en' : 'eis', 'en' ]; this.desinences.Subjuntivo.PreteritoImperfectoRa = ['iera', region !== 'formal' ? 'ieras' : 'iera', 'iera', 'iéramos', region !== 'castellano' ? 'ieran' : 'ierais', 'ieran' ]; this.desinences.Subjuntivo.PreteritoImperfectoSe = this.desinences.Subjuntivo.PreteritoImperfectoRa.map(d => d.replace(/ra/, 'se')); this.desinences.Subjuntivo.FuturoImperfecto = this.desinences.Subjuntivo.PreteritoImperfectoRa.map(d => d.replace(/ra/, 're')); } setImperativoAfirmativo() { super.setImperativoAfirmativo(); if (this.reflexive && this.region === 'formal') { this.table.Imperativo.Afirmativo[1] = stringutils_1.clearLastAccent(this.table.Imperativo.Afirmativo[1]); } } } exports.dar = dar; class desdar extends dar { constructor(verb, region, attributes) { super(verb, region, attributes); this.desinences.Indicativo.Presente = ['oy', region !== 'formal' ? 'ás' : 'á', 'á', 'amos', region !== 'castellano' ? 'án' : 'áis', 'án' ]; this.desinences.Indicativo.PreteritoIndefinido = ['í', region !== 'formal' ? 'iste' : 'ió', 'ió', 'imos', region !== 'castellano' ? 'ieron' : 'isteis', 'ieron' ]; this.desinences.Subjuntivo.Presente = ['é', region !== 'formal' ? 'és' : 'é', 'é', 'emos', region !== 'castellano' ? 'én' : 'éis', 'én' ]; } } exports.desdar = desdar; class desosar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = this.stem.replace(/o/, 'hue'); } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.alteredStem, this.alteredStem); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.alteredStem); } } exports.desosar = desosar; class enraizar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); } setIndicativoPresente() { const alteredStem = this.stem.replace(/(.*)i/, '$1í'); this.setIndicativoPresentePattern125(alteredStem, alteredStem); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.stem.replace(/iz$/, 'íc'), this.stem.replace(/iz$/, 'ic')); } setIndicativoPreteritoIndefinido() { this.setIndicativoPreteritoIndefinidoPattern0(this.stem.replace(/z$/, 'c')); } } exports.enraizar = enraizar; class errar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = `y${this.stem}`; } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.alteredStem, this.alteredStem); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.alteredStem); } } exports.errar = errar; class estar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.desinences.Indicativo.Presente = [ 'oy', region !== 'formal' ? 'ás' : 'á', 'á', 'amos', region !== 'castellano' ? 'án' : 'áis', 'án' ]; this.desinences.Subjuntivo.Presente = [ 'é', region !== 'formal' ? 'és' : 'é', 'é', 'emos', region !== 'castellano' ? 'én' : 'éis', 'én' ]; this.desinences.Indicativo.PreteritoIndefinido = caeIndicativoPreteritoIndefinido(region); this.desinences.Subjuntivo.PreteritoImperfectoRa = caeSubjuntivoPreteritoImperfectoRa(region); this.desinences.Subjuntivo.PreteritoImperfectoSe = caeSubjuntivoPreteritoImperfectoSe(region); this.desinences.Subjuntivo.FuturoImperfecto = caeSubjuntivoFuturoImperfecto(region); } setImperativoAfirmativo() { super.setImperativoAfirmativo(); if (this.reflexive) { switch (this.region) { default: this.table.Imperativo.Afirmativo[4] = stringutils_1.clearLastAccent(this.table.Imperativo.Afirmativo[4]); case 'castellano': this.table.Imperativo.Afirmativo[1] = stringutils_1.clearLastAccent(this.table.Imperativo.Afirmativo[1]); } } } } exports.estar = estar; class forzar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); } setIndicativoPresente() { const local = this.stem.replace(/o/, 'ue'); this.setIndicativoPresentePattern125(local, local); } setIndicativoPreteritoIndefinido() { this.setIndicativoPreteritoIndefinidoPattern0(this.stem.replace(/z$/, 'c')); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.stem.replace(/orz/, 'uerc'), this.stem.replace(/z/, 'c')); } } exports.forzar = forzar; class jugar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); } setIndicativoPresente() { const local = this.stem.replace(/g/, 'eg'); this.setIndicativoPresentePattern125(local, local); } setIndicativoPreteritoIndefinido() { this.setIndicativoPreteritoIndefinidoPattern0(this.stem.replace(/g$/, 'gu')); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.stem.replace(/g$/, 'egu'), this.stem.replace(/g$/, 'gu')); } } exports.jugar = jugar; class pagar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.desinences.Indicativo.PreteritoIndefinido[0] = 'ué'; this.desinences.Subjuntivo.Presente = this.desinences.Subjuntivo.Presente.map(d => `u${d}`); } } exports.pagar = pagar; class regar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = this.stem.replace(/(.*)e/, '$1ie'); this.desinences.Indicativo.PreteritoIndefinido[0] = 'ué'; this.desinences.Subjuntivo.Presente = this.desinences.Subjuntivo.Presente.map(d => `u${d}`); } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.alteredStem, this.alteredStem); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.alteredStem); } } exports.regar = regar; class rozar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = this.stem.replace(/z$/, 'c'); } setIndicativoPreteritoIndefinido() { this.setIndicativoPreteritoIndefinidoPattern0(this.alteredStem); } setSubjuntivoPresente() { this.setTable('Subjuntivo', 'Presente', Array_6.map(() => this.alteredStem)); } } exports.rozar = rozar; class sacar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); } setIndicativoPreteritoIndefinido() { this.setIndicativoPreteritoIndefinidoPattern0(this.stem.replace(/c$/, 'qu')); } setSubjuntivoPresente() { const alteredStem = this.stem.replace(/(.*)c/, '$1qu'); this.setTable('Subjuntivo', 'Presente', Array_6.map(() => alteredStem)); } } exports.sacar = sacar; class tropezar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = this.stem.replace(/e(.?)z$/, 'ie$1z'); } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.alteredStem, this.alteredStem); } setIndicativoPreteritoIndefinido() { this.setIndicativoPreteritoIndefinidoPattern0(this.stem.replace(/z$/, 'c')); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.stem.replace(/e(.?)z$/, 'ie$1c'), this.stem.replace(/z$/, 'c')); } } exports.tropezar = tropezar; class vaciar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); this.alteredStem = this.stem.replace(/(.*)i/, '$1í'); if (typeof this.attributes['M'] !== 'undefined' && this.attributes['M'] === 'true') { if (region === 'voseo') { this.desinences.Indicativo.Presente[1] = 'as'; } if (region === 'castellano') { this.desinences.Indicativo.Presente[4] = 'ais'; this.desinences.Subjuntivo.Presente[4] = 'eis'; } if (region === 'formal') { this.desinences.Indicativo.PreteritoIndefinido[1] = 'o'; } this.desinences.Indicativo.PreteritoIndefinido[0] = 'e'; this.desinences.Indicativo.PreteritoIndefinido[2] = 'o'; } } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.alteredStem, this.alteredStem); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.alteredStem); } } exports.vaciar = vaciar; class volcar extends hablar { constructor(verb, region, attributes) { super(verb, region, attributes); } setIndicativoPresente() { this.setIndicativoPresentePattern125(this.stem.replace(/(.*)o/, '$1ue'), this.stem.replace(/(.*)o/, '$1ue')); } setIndicativoPreteritoIndefinido() { this.setIndicativoPreteritoIndefinidoPattern0(this.stem.replace(/c$/, 'qu')); } setSubjuntivoPresente() { this.setSubjuntivoPresentePattern0125(this.stem.replace(/(.*)o(.*)c/, '$1ue$2qu'), this.stem.replace(/c$/, 'qu')); } } exports.volcar = volcar; //# sourceMappingURL=armodels.js.map