Public Member Functions | |
__init__ (restr=None) | |
get_sentence (permuted=False, structure='words', permtype='all', level=0) | |
get_sentence_with_marked_const (permuted=False, structure='words', permtype='all', level=1, choices=[]) | |
get_sentence_with_replacements (permuted=False, structure='consts', permtype='all', level=1, choices=[], wrong=1, correct=1) | |
check_permutation (origSentList, userSentList, permtype='all', level=0) | |
check_description (node, valueDict) | |
check_replacement (const, replConst) | |
get_repl_solution (constNode, choices) | |
get_perm_solution (sentList, permtype='all', level=0) | |
get_descr_solution (node, detailed=True, printFeats=None) | |
_check_and_repair_broken_const (termList) | |
_check_movable (const) | |
_check_np (npConst) | |
_build_permuted_sent (termNodeList) |
|
Initializes the program by instatiating module Grammar Calls |
|
takes a list of switched (terminal) ConstNodes and builds the appropriate ConstNode sentence representation if successful: returns a tupel (True, new_sentence_root_node) if not: returns a tupel (False, old_termNodeList) |
|
takes a list of ConstNodes and checks whether their order doesn't break a constituent; tries to repair broken consts by switching termNodes with the same surface in the list; returns a tupel of 'True' and a (possibly altered) ConstNode list or a tupel of 'False' and the original ConstNode list, if it could not be repaired. |
|
takes a movable ConstNode (Satzteil) and checks whether it has a legal structure returns (True, '') if everything is okay or (False, message_string) |
|
takes an np ConstNode and checks whether it has a legal structure returns: (True, '') if all is okay or (False, {'text': bad_np, 'errVal': 'surface_of_bad_np'}) |
|
takes a node and a Dict: {'name': ..., 'feats': {...}} NOTE: 'name' is obligatory, 'feats' not checks whether these fit the values of the node returns a message dictionary (structure see file conf_converter.py) NOTE: The value and key names *must* match the internal names! |
|
takes two sentLists (lists with ConstNodes) and tests whether they are legal permutations of each other; returns a message dict (structure see file conf_converter) |
|
checks whether a replConst is a legal replacement of const; returns a messageDict (structure see file conf_converter.py) |
|
takes a node and a flag value returns message dict with the grammatical description of the node (with features, if flag is set, only nodetype otherwise) if printFeats is set, only the values of the feats in this list are displayed |
|
takes a sentNode and permutation contraints returns message dict with legal permutations |
|
takes a const node and a list of choices returns a message dict with correct choice(s) |
|
takes several configurations for the new exercise sentence: if 'permuted' is set to 'False' a sentence with 'normal' word order will be returned; if 'permuted' is set to 'True', any sentence with a permutatition licenced by 'level' will be returned returns a list of either TermNodes (Words) or movable ConstNodes, depending on the value of 'structure' throws BadRestrictionError if no appropriate sentence can be generated |
|
returns tupel of a sentence list and index of a marked up constituent: (sentList, nr) (for word type exercise) the marked const is chosen according to the value of choices which is a list of possible values the constType may take (e.g. [n, fullverb, adj]) if after 5 tries, no sentence is found that contains an element that is member of choices, a BadRestrictionError is raised. |
|
returns a tupel containing:
|