[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Pattern matching among multiple chunks
- From: dyngeccetor8 <dyngeccetor8@...>
- Date: Wed, 16 Jan 2019 23:52:09 +0300
On 1/16/19 11:16 AM, pocomane wrote:
> I have a working parser that acts on a single string, but now I would
> like to extend it to get the input splitted among several chunks,
> without waiting for the whole data unless it is necessary.
> We consider, for example, the pattern
> to match against the following input:
> We suppose it is splitted in two chunks right in the middle.
> On the first chunk the match fails. But it may match if I wait for
> another chunk. How I can check for this? 
I think you need to implement finite state automata if
you need to know parsing state at any character of input.
Alternatively, you may limit maximum size of "valid" caption.
Say, to 8K. And then implement sliding window buffer of that
size with stock pattern matching.