Here is I think the actual computational grammar for Turkish in the Grammatical Framework framework:
I am going to read this page, which seems to explain how to read and understand those grammar code files, under “An Example of Usage”, but I am asking this question since there is not a lot of Stack Exchange-type direct question answers about GF online.
I want to select the most elemental rule from that Turkish grammar, something like S -> NP + VP
. This might be the grammar definitions for basic sentences.
I then would like a small lexicon of Turkish words, with part-of-speech classification, which I can use to construct sentences, by selecting a correct lexical element for each component of some rule. Here appears to be the GF Turkish lexicon.
I was wondering if anyone could help me understand which functions and files are the most fundamental for the grammar, on which everything else builds; and provide a code sample of basically adding a rule to some set of “current rules”, with a “build-sentence” function which asks for the appropriate word from the lexicon. In Python, this is the approximate idea:
current_rules = {“NP -> D + N”, “VP -> V + N”}
lexicon = {“N”: {“book”, “plate”, “foot”}, “V”: {“run”, “swim”, “think”, “like”}, “D”: {“the”, “a”, “some”}}
def build_sentence():
# ask the user to select a rule from the set of rules
# ask the user to select a lexical element of the correct type for each element in the rule
I can handle the Python on my own, but the question is about locating the correct rule to start with and how to implement it, given that the format is unknown to me, in Python.
Example of the format:
Pron = ResTur.Pron ;
Det = {s : Str; n : Number; useGen : UseGen} ;
Num = {s : Number => Case => Str; n : Number} ;
Card = {s : Number => Case => Str} ;
Ord = {s : Number => Case => Str} ;
(there are a variety of other, different programming expressions in GF as well).
Why am I doing this
Because I have a burning curiosity to try to learn a new language as a strictly cumulative set of rules and lexical elements which you practice recombining until you feel complete competence in them, whereupon you introduce a small expansion of rules and lexical elements until that larger system feels assimilated. I am not interested in someone’s opinion about if this is a good idea, just how.