From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA26234; Fri, 25 Jun 2004 18:23:04 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA26339 for ; Fri, 25 Jun 2004 18:23:02 +0200 (MET DST) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i5PGN1EV009168 for ; Fri, 25 Jun 2004 18:23:02 +0200 Received: from ibm3.cicrp.jussieu.fr (ibm3.cicrp.jussieu.fr [134.157.15.3]) by shiva.jussieu.fr (8.12.11/jtpda-5.4) with ESMTP id i5PGN1MG025290 ; Fri, 25 Jun 2004 18:23:01 +0200 (CEST) X-Ids: 165 Received: from ibm1.cicrp.jussieu.fr (ibm1.cicrp.jussieu.fr [134.157.15.1]) by ibm3.cicrp.jussieu.fr (8.8.8/jtpda/mob-V8) with ESMTP id SAA104958 ; Fri, 25 Jun 2004 18:21:10 +0200 Received: from localhost (fernande@localhost) by ibm1.cicrp.jussieu.fr (8.8.8/jtpda/mob-v8) with ESMTP id SAA610422 ; Fri, 25 Jun 2004 18:21:09 +0200 X-Authentication-Warning: ibm1.cicrp.jussieu.fr: fernande owned process doing -bs Date: Fri, 25 Jun 2004 18:21:09 +0200 (DST) From: Diego Olivier Fernandez Pons X-X-Sender: fernande@ibm1 To: Shawn Wagner cc: caml-list@inria.fr Subject: Re: [Caml-list] Substring search on an array of strings In-Reply-To: <20040624155121.GB595@speakeasy.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at nez-perce with ID 40DC5166.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at shiva.jussieu.fr with ID 40DC5165.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Antivirus: scanned by sophie at shiva.jussieu.fr X-Loop: caml-list@inria.fr X-Spam: no; 0.00; pons:01 pons:01 etu:99 caml-list:01 raevnos:01 pennmush:01 fernandez:01 fernandez:01 olivier:02 olivier:02 string:03 string:03 array:04 array:04 functions:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Bonjour, > Do you want to find out if one of the strings in the array equals some other > string, or if that other string appears as a substring in one of the array's > strings? Either way, annexlib has the needed functions: > http://raevnos.pennmush.org/code/annexlib/ Find out if a string appears as a substring in an array of strings and return the list of couples (string_index, position) of all matches. After having examined annexlib, it seems that it doesn't have a _specific_ function to do what I want. Of course I could always launch Array.size searches, one on each string. But it is a performance issue of course because the database is really big. Diego Olivier ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners