private void addEvents ( String sentence ) { String [ ] parts = sentence . split ( " " ) ; String outcome = NameFinderME . OTHER ; List toks = new ArrayList ( ) ; List outcomes = new ArrayList ( ) ; for ( int pi = 0 , pl = parts . length ; pi < pl ; pi ++ ) { if ( parts [ pi ] . equals ( "<START>" ) ) { outcome = NameFinderME . START ; } else if ( parts [ pi ] . equals ( "<END>" ) ) { outcome = NameFinderME . OTHER ; } else { //regular token toks . add ( parts [ pi ] ) ; outcomes . add ( outcome ) ; if ( outcome . equals ( NameFinderME . START ) ) { outcome = NameFinderME . CONTINUE ; } } } events = new Event [ toks . size ( ) ] ; for ( int ti = 0 , tl = toks . size ( ) ; ti < tl ; ti ++ ) { events [ ti ] = new Event ( ( String ) outcomes . get ( ti ) , cg . getContext ( ti , toks , outcomes , prevTags ) ) ; } for ( int ti = 0 , tl = toks . size ( ) ; ti < tl ; ti ++ ) { prevTags . put ( toks . get ( ti ) , outcomes . get ( ti ) ) ; } }
Adds name events for the specified sentence .