Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Substring search on an array of strings
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-06-24 (07:54)
From: Diego Olivier Fernandez Pons <Diego.FERNANDEZ_PONS@e...>
Subject: [Caml-list] Substring search on an array of strings

Caml Str library does not seem to provide a function allowing to match
efficently a string in a array of strings.

I was wondering if there were already known algorithms for this before
I try the workarounds I had in mind :

i) building a 'superstring' with the array of strings (the shortest
superstring problem is NP but there are simple primal-dual
approximation algorithms) and use a classical search algorithm.

ii) try to lift the suffix Knuth-Morris-Prat automaton to work on the
union of the words instead of a single word (is this possible ?)

        Diego Olivier

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: