Bonjour à tous,
Voici la suite de mes contraintes en temps d'execution pour mon programme, ici il s'agit de supprimer d'un texte les mots vides.
Je vais essayer de tout vous donner pour que l'on puisse faire les testes identiques (du moins sans tenir compte des processeurs) :
Voici le lien/texte à utiliser :
http://www.american.edu/ia/cfer/report/report.html
Voici ma fonction :
Et voici la liste des mots vides :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 function DeleteEmptyWord2(CONST Texte, sLang: String): String; var StringListMotsDuTexteAAusculter, lMotsVides : TStringList; i, j : integer; Begin result:=''; StringListMotsDuTexteAAusculter:=TStringList.Create; lMotsVides:=TStringList.Create; Try StringListMotsDuTexteAAusculter.Text:=Texte; if StringListMotsDuTexteAAusculter.Count>0 then Begin // 1. Virer les mots vides lMotsVides.LoadFromFile(ExtractFilePath(Application.ExeName)+'\'+cPathStopWord+'\'+sLang+'.fstw'); for i:=0 to lMotsVides.Count-1 do Begin j :=StringListMotsDuTexteAAusculter.IndexOf(lMotsVides[i]); While j>=0 do Begin StringListMotsDuTexteAAusculter.Delete(j); j :=StringListMotsDuTexteAAusculter.IndexOf(lMotsVides[i]); End; End; result:=StringListMotsDuTexteAAusculter.Text; End; Finally lMotsVides.Free; StringListMotsDuTexteAAusculter.Free; End; End;
a
about
above
after
again
against
all
am
an
and
any
are
aren't
as
at
be
because
been
before
being
below
between
both
but
by
can't
cannot
com
could
couldn't
de
did
didn't
do
does
doesn't
doing
don't
down
during
each
en
few
for
from
further
had
hadn't
has
hasn't
have
haven't
having
he
he'd
he'll
he's
her
here
here's
hers
herself
him
himself
his
how
how's
i
i'd
i'll
i'm
i've
if
in
into
is
isn't
it
it's
its
itself
la
let's
more
most
mustn't
my
myself
no
nor
not
of
off
on
once
only
or
other
ought
our
ours
ourselves
out
over
own
same
shan't
she
she'd
she'll
she's
should
shouldn't
so
some
such
than
that
that's
the
their
theirs
them
themselves
then
there
there's
these
they
they'd
they'll
they're
they've
this
those
through
to
too
und
under
until
up
very
was
wasn't
we
we'd
we'll
we're
we've
were
weren't
what
what's
when
when's
where
where's
which
while
who
who's
whom
why
why's
will
with
won't
would
wouldn't
www
you
you'd
you'll
you're
you've
your
yours
yourself
yourselves
Partager