Skip to main content
. 2019 Jun 19;7:e7170. doi: 10.7717/peerj.7170

Algorithm 1. Matching one line of input text with its corresponding patterns from the template file.

1: start0
2: for interval-length chunk Pij1 and fixed-length chunk Pjk all chunks do
3:  for s{jk|Pjs1are all not required} do
4:   loc list of candidate match locations of Ps in Tstart|T|
5:   for mlo and mhiloc do
6:     end end location in T when matching Ps+1k against the prefix of Tmhi|T|
7:     if end exists and Pij1 matches Tstartmlo then
8:      startend+1
9:       continue outer-most loop and handle the next pair of chunks
10:     end if
11:   end for
12:  end for
13:  return required pattern not matched match found
14: end for
15: return match found