--- On Wed, 3/20/13, S. Fisher expandaf...@yahoo.com wrote:
The program reads a text file and counts the number of
unique words,
and also displays the number of times the most common word
was found.
For comparison, here's a C++ program. Unlike the Pascal version,
it shows the 20 most
uses regexpr, classes;
var
pieces : tstringlist;
s : string;
begin
pieces := TStringList.create;
SplitRegExpr( '--+| *, *',
'thus--and even , hurly-burly,willy-nilly',
pieces );
for s in pieces do writeln( s, '');
pieces.destroy;
end.
Output:
thus
On 21-3-2013 2:14, S. Fisher wrote:
Not actually a hash-table, but an AvgLvlTree, which can
be used the
same way. The AvgLvlTree unit comes with Lazarus;
if you don't have
that, you can download avglvltree.pas here:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/lazutils
--- On Wed, 3/20/13, S. Fisher expandaf...@yahoo.com wrote:
The program reads a text file and counts the number of
unique words,
and also displays the number of times the most common word
was found.
Added an iterator of sorts for regular expressions. This allows
if re.exec( line
Not actually a hash-table, but an AvgLvlTree, which can be used the
same way. The AvgLvlTree unit comes with Lazarus; if you don't have
that, you can download avglvltree.pas here:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/lazutils/avglvltree.pas?root=lazarusview=log
There
Is there any way to iterate over a TFPDataHashTable ?
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
--- On Thu, 3/21/13, kyan alfasud...@gmail.com wrote:
HTH
Constantine
Are you the man who created Kyan Pascal? I used that many
years ago.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
--- On Mon, 12/22/08, Mark Morgan Lloyd markmll.fpc-pas...@telemetry.co.uk
wrote:
There's been a recent thread in fpc-other on second
languages, but it appeared to focus more on what was a
useful part of a developer's skillset rather than what
people miss from Pascal.
What /I/ miss is
Anyone who pretends to know how to use computers effectively
must know how to use grep. (grep is available for Windoze.)
Let's say that you want to search all of the files in the
current directory for lines that contain foobar or
foo bar or foo-bar, followed later in the line by
practise or
--- Daniël Mantione [EMAIL PROTECTED] wrote:
Op Wed, 5 Dec 2007, schreef Bee:
Hi all,
Is it just me or above methods are indeed not mentioned within fpc's doc
2.2.0? Any texts that are supposed to be a link to above methods is not
formed
as a link.
Just to make sure,
--- Florian Klaempfl [EMAIL PROTECTED] wrote:
S. Fisher schrieb:
It seems strange that this is slower on the shootout's computer
when it's faster both on my slow laptop and the 3GHz computer
at work.
The shootout uses a P4 which behaves sometimes strange regarding
optimization.
Well
--- Graeme Geldenhuys [EMAIL PROTECTED] wrote:
OK, while we are busy with show-and-tell... Then have a look at my
token library implementation.
http://tinyurl.com/395vgp
Sample Usage:
tokenizer := TTokens.Create(FieldSpecLine, ', ', '', '', '\',
I don't think so, although it's over twice as fast as the
last incarnation.
One speedup I stole from the Perl program:
instead of counting matches for /foo|bar/, count matches
for /foo/ and for /bar/.
The other speedup is lowercasing the string that is searched
instead of requiring the regex
--- Graeme Geldenhuys [EMAIL PROTECTED] wrote:
The code shown in the url below works just fine. Also the usage sample
is all you need to use the tokenizer. Just replace the FieldSpecLine
variable with the content from a CSV file and you are good to go. I
use it as-is in my production code.
Fields are separated by commas, but if a field is surrounded by
double quotes it can contain commas---in fact, can contain any
byte whatsoever; double quotes () within the field must be
doubled, just as single quotes within a Pascal string are doubled.
All we need in order to parse a csv record
This is faster than the one at the shootout
(shootout.alioth.debian.org/gp4/benchmark.php?test=fannkuchlang=fpascalid=3)
on my computer. See if it's faster on yours.
{ The Computer Language Shootout
http://shootout.alioth.debian.org/
contributed by Florian Klaempfl
modified by Micha
Instead of looking for 'B' and replacing with '(c|g|t)'),
then looking for 'D' and replacing with '(a|g|t)', etc.,
the program now looks for '[BDH...Y]' and replaces with
the corresponding string.
{ The Computer Language Benchmarks Game
http://shootout.alioth.debian.org
contributed by Steve
--- Marco van de Voort [EMAIL PROTECTED] wrote:
Doing a dumb header port is not that hard. If you can't do it, start
making
tests, and I'll do it.
(skip nonsense stuff)
So why use the JCL? Just do all the translations yourself.. forget JCL.
- JCL's license is MPL and thus not
--- Florian Klaempfl [EMAIL PROTECTED] wrote:
S. Fisher schrieb:
This is faster than the one at the shootout
(shootout.alioth.debian.org/gp4/benchmark.php?test=fannkuchlang=fpascalid=3)
on my computer. See if it's faster on yours.
Indeed, just submit it.
There's a slight problem. I
first email. Which I cannot download, and am waiting for Jeff
to
reply. In the mean time, S. Fisher has already got a unit working while we
were
yapping.
L505
For everbody who wants pcre, here's how I got it working.
From http://www.renatomancuso.com/software/dpcre/dpcre.htm,
download PCRE 6.7
--- Florian Klaempfl [EMAIL PROTECTED] wrote:
Ok, now somebody has to fix the regexpr unit and accelerate it *g*
The C program in the shootout uses pcre (Perl-compatible
regular expressions). It would be very nice if FPC came
with pcre.
__
--- Florian Klaempfl [EMAIL PROTECTED] wrote:
S. Fisher schrieb:
--- Florian Klaempfl [EMAIL PROTECTED] wrote:
Ok, now somebody has to fix the regexpr unit and accelerate it *g*
The C program in the shootout uses pcre (Perl-compatible
regular expressions). It would be very
--- L [EMAIL PROTECTED] wrote:
Ok, now somebody has to fix the regexpr unit and accelerate it *g*
The C program in the shootout uses pcre (Perl-compatible
regular expressions). It would be very nice if FPC came
with pcre.
Well, that way we can never win :) Anyways, I think
http://shootout.alioth.debian.org/gp4/benchmark.php?test=alllang=all
The reason is that D's mean degraded from 1.40 to 1.43. I wonder how
that could happen.
__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
--- Marco van de Voort [EMAIL PROTECTED] wrote:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=alllang=all
The reason is that D's mean degraded from 1.40 to 1.43. I wonder how
that could happen.
They change often. Clean is also quite variable. I assume the differences
are
--- Vincent Snijders [EMAIL PROTECTED] wrote:
S. Fisher schreef:
Is it true that a slow program has a worse effect on the shootout
results than a missing program? That seems wrong to me.
To me is seems wrong too, but is nevertheless the case.
Right. A missing program should
--- Marc Weustink [EMAIL PROTECTED] wrote:
if not GenerateRegExprEngine( target, [ref_caseinsensitive], engine)
then
begin
writeln( 'Failed to generate regex. engine for ',target,'.' );
halt(1)
end;
For this benchmark you don't need extra unneeded code for checking
--- Peter Vreman [EMAIL PROTECTED] wrote:
reasonable time. The updated source can be found in:
http://svn.freepascal.org/svn/fpc/trunk/tests/bench/shootout/src/regexdna.pp
But the code is a lot slower than gcc so there is still a lot of
performance tuning to do:
10
--- Dani�l Mantione [EMAIL PROTECTED] wrote:
Is it true that a slow program has a worse effect on the shootout
results than a missing program? That seems wrong to me.
There has been a long discussion on the Shootout forums about it. Isaac
believes that it is more fair this way for
--- L [EMAIL PROTECTED] wrote:
No more strlen:
http://www.hu.freepascal.org/fpcircbot/cgipastebin?msgid=1432
This doesn't work if you have spaces in front of the tags
sometag
sometag
I'm not sure if the Perl one fails too though.
I don't have perl installed and can't
30 matches
Mail list logo