def find_prepositions(chunked):
<EOL>for ch in chunked:<EOL><INDENT>ch.append("<STR_LIT:O>")<EOL><DEDENT>for i, chunk in enumerate(chunked):<EOL><INDENT>if chunk[<NUM_LIT:2>].endswith("<STR_LIT>") and chunk[-<NUM_LIT:1>] == "<STR_LIT:O>":<EOL><INDENT>if i < len(chunked)-<NUM_LIT:1> and(chunked[i+<NUM_LIT:1>][<NUM_LIT:2>].endswith(("<STR_LIT>", "<STR_LIT>")) orchunked[i+<NUM_LIT:1>][<NUM_LIT:1>] in ("<STR_LIT>", "<STR_LIT>")):<EOL><INDENT>chunk[-<NUM_LIT:1>] = "<STR_LIT>"<EOL>pp = True<EOL>for ch in chunked[i+<NUM_LIT:1>:]:<EOL><INDENT>if not (ch[<NUM_LIT:2>].endswith(("<STR_LIT>", "<STR_LIT>")) or ch[<NUM_LIT:1>] in ("<STR_LIT>", "<STR_LIT>")):<EOL><INDENT>break<EOL><DEDENT>if ch[<NUM_LIT:2>].endswith("<STR_LIT>") and pp:<EOL><INDENT>ch[-<NUM_LIT:1>] = "<STR_LIT>"<EOL><DEDENT>if not ch[<NUM_LIT:2>].endswith("<STR_LIT>"):<EOL><INDENT>ch[-<NUM_LIT:1>] = "<STR_LIT>"<EOL>pp = False<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>return chunked<EOL>
The input is a list of [token, tag, chunk]-items.
        The output is a list of [token, tag, chunk, preposition]-items.
        PP-chunks followed by NP-chunks make up a PNP-chunk.