@staticmethod<EOL><INDENT>def candidates(text):<DEDENT>
for Pmatch in finditer(TARGET, text):<EOL><INDENT>P = Pmatch.group(<NUM_LIT:1>)<EOL>B = bool(match(NEWLINE, Pmatch.group(<NUM_LIT:5>)))<EOL>start = Pmatch.start()<EOL>end = Pmatch.end()<EOL>Lmatch = search(LTOKEN, text[max(<NUM_LIT:0>, start - BUFSIZE):start])<EOL>if not Lmatch:  <EOL><INDENT>continue<EOL><DEDENT>L = word_tokenize("<STR_LIT:U+0020>" + Lmatch.group(<NUM_LIT:1>))[-<NUM_LIT:1>]<EOL>Rmatch = search(RTOKEN, text[end:end + BUFSIZE])<EOL>if not Rmatch:  <EOL><INDENT>continue<EOL><DEDENT>R = word_tokenize(Rmatch.group(<NUM_LIT:1>) + "<STR_LIT:U+0020>")[<NUM_LIT:0>]<EOL>yield Observation(L, P, R, B, end)<EOL><DEDENT>
Given a `text` string, get candidates and context for feature
extraction and classification