write a python function that takes a string containing a german word in Präsens Aktiv…
- User
write a python function that takes a string containing a german word in Präsens Aktiv Indikativ tense and returns the correct infinitive form of that word by making appropriate edits to the word.
Assistant
pythondef get_infinitive(word): """Returns the infinitive form of a German word in Präsens Aktiv Indikativ tense. Args: word: A string containing a German word in Präsens Aktiv Indikativ tense. Returns: A string containing the infinitive form of the word. """ # Remove the conjugation suffix from the word. if word.endswith("e"): word = word[:-1] elif word.endswith("st"): word = word[:-2] elif word.endswith("t"): word = word[:-1] # If the word ends in a vowel, add "n" to the end. if word[-1] in "aeiou": word += "n" # Return the infinitive form of the word. return word
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.