def expand_all_semantics(production_rules, semantics_rules):
    """
    Expands all semantics rules
    :param production_rules:
    :param semantics_rules:
    """
    for utterance, parse in semantics_rules.items():
        yield From(
            generate_sentence_parse_pairs(utterance, production_rules,
                                          semantics_rules, False))
示例#2
0
 def gen():
     yield From([1, 2, 3])
     yield [4, 5, 6]
示例#3
0
 def gen():
     yield 1
     yield From(subgen())
     yield 4
示例#4
0
 def subgen():
     yield From(subsubgen())
     yield 3
示例#5
0
 def gen():
     yield 1
     ret = (yield From(subgen()))
     yield 4
     yield ret
示例#6
0
 def gen():
     yield From(non_gen())
示例#7
0
 def gen():
     try:
         yield From(subgen())
     except ValueError:
         yield 1
示例#8
0
 def gen():
     yield 1
     yield From(ValueError)
     yield From(None)
     yield 2