New answers tagged natural-language
2
JavaScript (V8), 191 bytes
p=>v=>v.replace(/.r$/,e=>({"Yo":"o","Él":x=e[0]=="a"?"a":"e","Tú":x+"s","Ea":x,"Ud":x,"Ns":e[0]+"mos","Vs":({"a":"áis","e":"éis","i":"ís&...
0
JavaScript (Node.js), 195 bytes
(p,v)=>(x=v.charAt(v.length-2))&&(y=p.charAt(0))&&v.substring(0,v.length-2)+(p=='Yo'?'o':p.endsWith('ros')?x+(y=='N'?'mos':(x=='i'?'':'i')+'s'):(x=='i'?'e':x)+(y=='T'?'s':p.endsWith('s')?'n':''))
Try it online!
Doesn't handle the stem changes. It would cost a few more bytes to add the accents to the ...
Top 50 recent answers are included
Related Tags
natural-language × 129code-golf × 109
string × 49
code-challenge × 13
kolmogorov-complexity × 10
classification × 7
number × 6
decision-problem × 5
popularity-contest × 5
parsing × 5
sorting × 5
word-puzzle × 5
integer × 4
date × 4
conversion × 4
math × 3
random × 3
graph-theory × 2
counting × 2
polyglot × 2
regular-expression × 2
generation × 2
test-battery × 2
logic × 2
text-processing × 2