From: Philippe Veber <philippe.veber@gmail.com>
To: "Francois????Charles Matthieu????Berenger" <Berenger@riken.jp>
Cc: Edgar Friendly <thelema314@gmail.com>,
"caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: Re: [Caml-list] Efficient scanning of large strings from files
Date: Mon, 19 Mar 2012 10:08:44 +0100 [thread overview]
Message-ID: <CAOOOohTY_FTw0xBxzk5O8Y_MJ5z2sY_is7s5dJhbRtbKnAsrYA@mail.gmail.com> (raw)
In-Reply-To: <1331918628011613.Berenger@riken.jp>
[-- Attachment #1: Type: text/plain, Size: 2295 bytes --]
Yes indeed!
2012/3/16 Francois????Charles Matthieu????Berenger <Berenger@riken.jp>
> hi philippe,
>
> i am curious, is your string a dna sequenceso that s why it is so long?
>
> regards,f
>
>
> On Fri, 16 Mar 2012 10:14:41 -0400
> Edgar Friendly <thelema314@gmail.com> wrote:
>
> > On 03/16/2012 09:03 AM, Philippe Veber wrote:
> > > Dear camlers,
> > >
> > > Say that you'd like to search a regexp on a file with lines so long
> that
> > > you'd rather not load them entirely at once. If you can bound the size
> > > of a match by k << length of a line, then you know that you can only
> > > keep a small portion of the line in memory to search the regexp.
> > > Typically you'd like to access substrings of size k from left to right.
> > > I guess such a thing should involve buffered inputs and avoid copying
> > > strings as much as possible. My question is as follows: has anybody
> > > written a library to access these substrings gracefully and with decent
> > > performance?
> > > Cheers,
> > > Philippe.
> > >
> > This is tricky to do, as incremental matching implies DFA-based
> > matching, but returning matching substrings implies backtrack-based
> > matching. The re2 library returns matching substrings by matching
> > forward to find the end of patterns, and then matching backwards on the
> > reversed regex from that point to find their beginning. I don't know if
> > even it supports this on incremental input.
> >
> > Subject to the assumption that starting to match implies either
> > finishing or aborting a match (i.e. once you've started to match your
> > regex, no other match will start before either this match attempt
> > finishes successful or not), this is not unreasonable to do. Without
> > this assumption, it requires tracking many match start locations and
> > somehow knowing which of them match or fail to match. I'm not sure this
> > has been done before.
> >
> > E.
> >
> > --
> > Caml-list mailing list. Subscription management and archives:
> > https://sympa-roc.inria.fr/wws/info/caml-list
> > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> > Bug reports: http://caml.inria.fr/bin/caml-bugs
> >
>
>
>
>
[-- Attachment #2: Type: text/html, Size: 3210 bytes --]
next prev parent reply other threads:[~2012-03-19 9:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-16 13:03 Philippe Veber
2012-03-16 14:14 ` Edgar Friendly
2012-03-16 14:48 ` Philippe Veber
2012-03-16 17:02 ` Edgar Friendly
2012-03-19 9:08 ` Philippe Veber
2012-03-19 13:44 ` Edgar Friendly
2012-03-21 7:21 ` Philippe Veber
2012-03-16 17:23 ` Francois????Charles Matthieu????Berenger
2012-03-17 16:53 ` oliver
2012-03-19 9:08 ` Philippe Veber [this message]
2012-03-16 14:49 ` Jérémie Dimino
2012-03-18 21:11 ` Török Edwin
2012-03-19 9:11 ` Philippe Veber
2012-03-16 20:11 ` oliver
2012-03-18 23:56 ` oliver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOOOohTY_FTw0xBxzk5O8Y_MJ5z2sY_is7s5dJhbRtbKnAsrYA@mail.gmail.com \
--to=philippe.veber@gmail.com \
--cc=Berenger@riken.jp \
--cc=caml-list@inria.fr \
--cc=thelema314@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox