In linguistics, a case role describes the function of a noun in a sentence with relation to the sentence's main verb. Some languages have formal case systems, in which the form of the noun determines its case. Other languages' case systems are determined by syntax, or word order. In either situation, linguists may make distinctions between a case's surface structure and its deep structure, meaning that different nouns might seem to have the same case but actually serve different functions. The process of determining the deep structure of a case role is one goal of natural language processing.
At its most basic, a case role is the grammatical function of a noun in a sentence, such as the subject noun, direct object, indirect object, etc. In English, one can typically determine these functions by word order, since a sentence will typically follow this pattern: subject noun, verb, indirect object, direct object. Of course, there are many variations to this basic pattern, but the syntax of a sentence provides the necessary information to determine the grammatical function of the noun. Inflected languages, such as Latin or Greek, use word endings to indicate grammatical function.
The situation is complicated, however, by the fact that nouns appearing to be in the same case may have different semantic functions. For example, the two sentences "The butler killed the cook with arsenic" and "The butler killed the cook with ease" each contain the preposition "with" followed by a noun. Logically, however, the two nouns do not have the same semantic function. "With arsenic" describes the instrument with which the cook was killed, but "with ease" describes the manner in which the cook was killed.
This example demonstrates the difference between surface structure and deep structure. The two sentences have the same syntactical construction, and the objects of the two prepositions would probably be in the same formal case in an inflected language. This means that they have the same "surface structure." On the other hand, they do not have the same "deep structure," since the semantic meanings are different. The two nouns, then, do not have the same case role even though they seem to have the same grammatical role.
One application of case role is in the field of natural language processing, which analyzes the relationship between human languages and computer languages. One goal of natural language processing is to program computers to detect deep structure of human languages for information extraction, translation, or other purposes. While it is fairly easy for a human to determine that "with arsenic" and "with ease" do not have the same semantic function, this difference is not as easily recognized by a computer. For instance, for a computer to translate the above sentence into a language where the two phrases would not have the same surface structure, it would need algorithm for determining the deep structure of the sentence.