private boolean containsDate ( String [ ] strs , int tolerance ) { dfirst = - 1 ; dlast = - 1 ; int lastdw = - 999 ; int lastnum = - 999 ; int lastyear = - 999 ; for ( int i = 0 ; i < strs . length ; i ++ ) { if ( isMonthName ( strs [ i ] ) ) { lastdw = i ; if ( lastdw - lastnum <= tolerance ) return true ; } else if ( isYear ( strs [ i ] ) ) { lastyear = i ; if ( lastyear - lastnum <= tolerance ) return true ; } else if ( isNum ( strs [ i ] ) ) { lastnum = i ; if ( lastnum - lastdw <= tolerance ) return true ; } } return false ; }
Searches for sequences like num month or month num or num year in the string .