The MASM Forum Archive 2004 to 2012

General Forums => The Laboratory => Topic started by: hutch-- on June 28, 2006, 12:56:44 AM

Title: A matching in place tokeniser for text line data
Post by: hutch-- on June 28, 2006, 12:56:44 AM
This version tokenises lines of text in place with the characteristics of skipping blank lines and trimming any leading tabs and spaces from the line. It outputs an array of pointers and the line count. This algo is well suited for setting up an array of words for sorting but equally well handles sentences, phrases etc ...

The example has the algo testing simple data for correctness, sorts the same data and a trailing benchmark from the windows.inc file which again is too small to get meaning ful timings from.

[attachment deleted by admin]
Title: Re: A matching in place tokeniser for text line data
Post by: James Ladd on June 28, 2006, 10:36:08 PM
Hutch,

Very nice indeed. I learn so much from you so thanks for taking the time to do and post stuff like
this. Now if only I could get you to join me personal project?

Note: The ltok program expects /masm32/include/windows.inc to exist !

Rgs, James.
Title: Re: A matching in place tokeniser for text line data
Post by: hutch-- on July 03, 2006, 02:58:22 AM
I modified the original by removing the table as it could be replaced by one compare which reduces one memory access for each loop iteration and re-ordered the second loop so that the most common case has the shortest loop. Algo is smaller and should be faster. As before, the hard coded example using windows.inc is too small to produce meaningful results.

[attachment deleted by admin]