Public Member Functions | |
__init__ () | |
get_new_sentence (permuted, permtype, level, checkPerm=False) | |
get_all_permutations (sentNode, permtype, level) | |
get_wrong_replacements (constNodeList, index, maxRes) | |
get_correct_replacements (const, maxRes) | |
check_permutation (constNode1, constNode2, permtype, level) | |
reparse_sent_surface (ConstNodeList, level=0) | |
reparse_node (constNode) | |
_generate_repl_query (const, ignoreFeats=[], notEqual=[]) |
|
initializes the grammar wrapper and the prolog description parser |
|
generates a prolog query to get (wrong or correct) replacements for const; the replacements are always of the same ConstNode type as const 'ignoreFeats' are the features of const that can be ignored 'notEqual' are the features whose values mustn't match the values of const |
|
takes two ConstNodes and checks whether they are legal permutations of each other returns a list of messages (strings) |
|
takes a sentence ConstNode and permutation restrictions returns a list of all legal permutations converted to ConstNodes |
|
takes a ConstNode and generates a list of maxRes ConstNodes, that are of the same type as the node and can replace it; if less than maxRes replacements are found, the results are still returned |
|
presents a new sentence from the grammar as a ConstNode root; parameters 'permuted', 'permtype' and 'level' affect the possible order of the sentence constituents if checkPerm is set to True, only sentences that can be legally permuted will be returned |
|
takes a ConstNode and returns a list of maxRes ConstNodes, which are of the same type as the node, but can *not* replace it; if less than maxRes relacements are found, the results are still returned |
|
takes a ConstNode and checks whether its structure is accepted by the grammar; returns True or False NOTE: This function also checks the node structure, not only the surface |
|
takes a List of ConstNodes and checks whether their surfaces form a legal sentence; level can be specified to make some permutations illegal returns True or False |