Exemplo n.º 1
0
def get_verb_from_chunked_sentence(chunk):
    vbdix = transformations.first_chunk_index(chunk, lambda (word, tag): tag.startswith("VB"))
    return vbdix
Exemplo n.º 2
0
def process_command(chunk, verb, start_searching_noun_id):
    noun_id = transformations.first_chunk_index(
        chunk, lambda (word, tag): tag.startswith("NN"), start=start_searching_noun_id, step=1
    )
    execute_command(verb, chunk[noun_id][0])