8
3
Explanation
¡Hola! For those of you who don't take Spanish, a verb is conjugated based on the person who does the action. Here's a chart:
English Spanish
I Yo
You Tú
He Él
She Ella
You (formal) Usted
We all Nosotros
You all Vosotros
They (masculine, plural) Ellos
They (feminine, plural) Ellas
You (plural) Ustedes
In Spanish, all verbs end with ar
, er
, or ir
. Here's another helpful chart:
Ar Er Ir
Yo o o o
Tú as es es
Él a e e
Ella a e e
Usted a e e
Nosotros amos emos imos
Vosotros áis éis ís
Ellos an en en
Ellas an en en
Ustedes an en en
Given a pronoun and a verb, print the verb conjugated using the pronoun in the present tense. Don't worry about stem changing and odd verbs.
Examples
Input Output
Yo escribir Escribo
Tu enseñar Enseñas
Ella querer Quere (It should be quiere but ignore stem changes)
If your language doesn't support printing with accents, you can omit them. Otherwise, it shouldn't take any more characters to use á instead of a in your code.
You can find more words with which to test here: http://spanish.speak7.com/spanish_vocabulary_verbs.htm. Note that contester should be contestar.
Challenge: Stem Changes
In Spanish, some verbs have stem changes. Let's take the verb querer
for example. In all forms except nosotros and vosotros, the first e
changes to ie
. So, yo quiero
, but nosotros queremos
. If your program can account for stem changes, you may subtract twice the length of each word you support from your final score. For example, if you support the i
-> ie
change querer
and only querer
, you can subtract twice the length of querer
, or 12, from your score.
For some stem-changing verbs, try this: https://conjuguemos.com/chart.php?language=spanish&id=2&etre=no&commands=no&all=no&source=public
Small Bonuses
Just for fun, if you explain what your code does in Spanish, take off 30 from your score. Don't just use Google Translate or I'll be able to tell that you cheated.
(As I am not a native Spanish speaker, please correct me on any mistakes)
Empezo
orEmpiezo
? – Stan Strum – 2018-04-26T16:15:52.9672I don't take Spanish: I just speak it; but a) tú is the nominative form of the pronoun: tu is genitive; b) verbs aren't "paired" with pronouns; c) nominative pronouns are rarely used in Spanish, so this exercise teaches bad habits; d) you should mention that this is only conjugating the present indicative; e) you haven't said how to handle pronomial (aka reflexive) verbs; f) the most common verbs are irregular, so this isn't a practical tool: if you want to make a verb conjugation question without worrying about irregularities you should use Esperanto instead of Castellano. – Peter Taylor – 2014-03-14T15:50:00.447
a) With what should I replace it? b) How would you word it? c) Not quite sure what you mean. The first example,
yo escribo
seems like something someone would commonly say. d) I'll fix that. e) You can assume that these
isn't given (ex:yo despertar
). f) Not really meant to be practical, and I'll add a challenge for stem changes and one for verbs likeser
andestar
. Also not sure what Esperanto and Castellano are. Different forms of Spanish? – nrubin29 – 2014-03-14T16:19:41.267a) tú; b) Verbs are conjugated according to tense, mood, and grammatical person; c) A native speaker would say Escribo with no pronoun unless really stressing the pronoun; f) Esperanto is an artificial language which has no irregular verbs. – Peter Taylor – 2014-03-14T16:35:47.953
1a) Fixing that now. b) Fair enough, fixing. c) True, but this is meant more as a challenge than a useable tool. I could remove the requirement to print the pronoun (yo escribir -> escribo) but I'd rather leave it in. f) I'll just leave it in "normal" Spanish and add a challenge for "special" verbs. Hope I didn't come off as rude, I appreciate the feedback. – nrubin29 – 2014-03-14T16:39:17.410
Input Yo, Escribir. Correct output: Escribo (except if the person REALLY wants to stress I write!) Input Tu, Enseñar. Correct output: Enseñas (except if the person really wants to stress YOU teach.) Forget about querer, it's irregular. Here's a list of regular verbs from a quick search (contester is wrong, it should be contestar but I haven't found any other mistakes.) http://spanish.speak7.com/spanish_vocabulary_verbs.htm. I'm a native english speaker who's spent 5 years in Madrid by the way.
– Level River St – 2014-03-14T16:44:06.080How should the accented letters be handled? They're not part of standard 7 bit ASCII. You need to specify an extended ASCII codepage, or Unicode, or whatever. Alternatively there's the rather ugly alternative of typing apostrophe or ~ before the relevant letter (which is incorrect but unambiguous.) – Level River St – 2014-03-14T16:50:16.020
@steveverrill I'll amend the examples so they don't print the pronoun. Also, the querer example was just to show that even if an irregular verb was entered, the stem wouldn't need to be changed. I'll add a link to that list above. You can ignore accents if your language doesn't support printing with them. – nrubin29 – 2014-03-14T16:53:27.733
Linguistically it's looking much better now (except ustedes is you plural, not they.) However you need to clarify how to handle non ASCII accents in both input (especially the pronouns that need to be recognised) and output. Parsing accented pronouns is going to be a real headache. Either specify how this should be done or specify that it's not required (seeing as you've already cut the language down from 7 tenses to one.) That "quere" looks horrible to me but I accept that it's the only way. I have seen similar sacrilege of (for example) musical conventions in other questions. – Level River St – 2014-03-14T17:11:51.733
@rusher the OP has clarified we don't have to consider accents. Therefore we can parse él and ella as just e***. Relevant, and handy, given they conjugate the same. – Level River St – 2014-03-14T17:45:30.373
@steveverrill Fixed ustedes. – nrubin29 – 2014-03-14T18:16:36.597
3While I was in the middle of working on my answer, you changed the scoring by adding a bonus challenge! I'm no longer interested in golfing this because of the additional bonus score modification and the promise of more changes to come. I already wasted an hour on it, and that hour has become your downvote. – Rainbolt – 2014-03-14T20:30:31.340
@Rusher I don't quite understand what you mean. I'm sorry you feel like you wasted an hour, but I think you should still post your answer. I feel like adding challenges makes it more interesting, but you don't need to accept them. Besides, I can't think of too many more challenges that I could add. – nrubin29 – 2014-03-14T20:33:26.390
2@nrubin29: I didn't downvote but I agree w/ Rusher. You shouldn't change the scoring and rules after the question has been posted - especially after an answer has already been posted. Use the sandbox if you're not happy w/ the question yet. – Claudiu – 2014-03-14T20:34:02.533
@Claudiu Fair enough. This is my first question, so I wasn't quite sure how stuff works here. I won't make any more changes. – nrubin29 – 2014-03-14T20:35:45.010
just present tense? come on, we have a lot of tenses to pick from, some other has to be more interesting :p. As Claudiu said, if you think the question could benefit from feedback, post it in the last sandbox thread in http://meta.codegolf.stackexchange.com (I think the actual is X). Changing the requirements after posting here is rude towards the people who already started to work on an answer
– Einacio – 2014-03-14T20:48:10.640@Einacio the problem with doing more tenses is that, beside having to take in a lot of linguistic data, there'll be a lot of abuse of irregular verbs (ya me choca un montón lo de "quere.") Anyway, as you say, I don't think he should change it more now. I don't fully agree with the new bonuses but -30 for explaining in Spanish is easy for me (even easier for you!) so I may as well take advantage. If I wanted I could probably get -1000 for stem changing verbs (but I think that's unsporting.) Theres about 100 verbs of that type here: http://www.spanishdict.com/answers/100045/present-tense#stem
– Level River St – 2014-03-14T21:21:33.887@steveverrill The -30 for posting an explanation in Spanish is pointless. I don't know more than a few words of Spanish, and I certainly don't plan on learning it for a programming challenge. – grovesNL – 2014-03-15T18:58:16.310
1@grovesNL at least that -30 doesn't make a huge difference. The thing that's killed this question is the unlimited bonus for stem changing verbs. I thought we'd ironed out the ambiguities for the OP, then he suddenly threw in two new bonuses and offended Rusher. Hopefully he'll learn to think ahead, use the sandbox, and not add bits to his questions after posting. It's too late to go back now. – Level River St – 2014-03-15T19:05:51.390
The only reason why I implemented the Spanish explanation thing was to add a little fun and keep with the theme. I didn't realize how uber-competitve everyone was here. As I said before, I'm new here, so I didn't know that you couldn't add new challenges later (I did know that you can't overhaul the question, of course). I did not know what the sandbox was, therefore I didn't use it. Also, again, I'm sorry for offending anyone by changing the question. I'll probably stay away from asking questions from now on. – nrubin29 – 2014-03-15T19:13:15.960
1
@nrubin29 it's not a bad question at all. We aren't cutthroat competitive, but we do have a strong sense of fair play. We're also good at finding loopholes and if done right it's applauded. That means properly specifying a code-golf question is quite demanding as you must anticipate this (you can see the tricks people use!) Feel free to use the sandbox next time, the community will help you work on your question and make it as fair and unambiguous as possible. Judging by popularity-contest is another way to take the pressure off you. See also http://meta.codegolf.stackexchange.com/q/1061/15599
– Level River St – 2014-03-15T19:29:42.427@steveverrill Thanks for the comment, that was extremely helpful. I'll use the sandbox next time. The reason why I chose code golf as opposed to popularity contest is that all answers will do the exact same thing. I guess it could go either way, but of course I'm not going to change anything ;) – nrubin29 – 2014-03-15T19:37:23.100
@nrubin29: I just want to add that I enjoyed doing this code-golf. The changing-stem challenge was a bit too open-ended (I have a huge negative score) but it was also fun to write that. So I do encourage you to ask more questions! It is indeed difficult to come up w/ a good one. – Claudiu – 2014-03-15T22:45:01.643