|
|
|
|
|
by mcaruso
3374 days ago
|
|
I've made the analogy of function calls before, it's a pretty cool way to think about it. But I think your example is slightly off. The verb is the head of the phrase, and would thus be the function (or command) itself: miru --topic=Taro --object=Noriko # Taro sees Noriko
This uses "miru", the plain non-past form of "to see". Conjugating the verb is a little trickier to translate, but I think it would be analogous to higher-order functions, functions that modify the verb to create a new verb. Using a Python-like syntax: formal(past(miru))(topic="Taro", object="Noriko")
# Taro wa Noriko wo mimashita
I'm trying to think of a way to include relative clauses in this analogy, but it's a little harder. A relative clause is of the form "[verb-phrase] [noun]", e.g. "doresu wo kiru Noriko" (Noriko who wears a dress). Maybe we could use positional arguments for this: formal(past(miru))(topic="Taro", object=kiru(object="doresu", "Noriko"))
# Taro wa doresu wo kiru Noriko wo mimashita ??
EDIT: or maybe currying would be a nice way to solve this. So each verb would be a function that takes arguments, and returns a new function that takes a noun to apply that verb to: formal(past(miru))(topic="Taro", object=kiru(object="doresu")("Noriko"))
# Taro wa doresu wo kiru Noriko wo mimashita
|
|
*Please help correct any errors, as I have never formally studied the Japanese language.