F
folkvord
Hi!
I am trying to make an index of a lot of textfiles. Since the index
thends to get quite large, I want to optimize my algorithm som that if
$string is a part of a element already stored in @words it won't be
added to the array.
As an example:
my @words=qw(this is just an example of words);
$string = "his";
Since "his" is a substring of "this", it shouldnt be neccessary to
index it. But I cant figure out an efficient way to check if $string is
a substring of an element in the array.
Can anyone give me a hint her, please ?
I am trying to make an index of a lot of textfiles. Since the index
thends to get quite large, I want to optimize my algorithm som that if
$string is a part of a element already stored in @words it won't be
added to the array.
As an example:
my @words=qw(this is just an example of words);
$string = "his";
Since "his" is a substring of "this", it shouldnt be neccessary to
index it. But I cant figure out an efficient way to check if $string is
a substring of an element in the array.
Can anyone give me a hint her, please ?