Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FAST TEXT SEARCH for Clipper v.2.0 - <b>verifying aliases - step 3</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   Verifying Aliases - Step 3

   We have made repeated reference to a step called verification. We do 
   this because when you create a CFTS index, the system transforms the 
   original text into a text signature that represents the original text 
   in a coded form. When you search for a particular string, CFTS looks 
   in the index for any and all instances of signatures that contain all 
   of the attributes of the string you are searching for. While this is a 
   powerful technique, it does have one drawback. It is possible that two 
   different strings will resolve to the same signature within the index. 
   Consequently, when CFTS returns a hit during a CftsNext() call, you 
   must verify that the text you are searching for is actually contained 
   in the returned record by performing a more conventional sub-string 
   search with the target string.

   The FAST TEXT SEARCH for Clipper library contains a function that will 
   efficiently perform this verification, CftsVeri(). This version of 
   CFTS has a completely rewritten and highly optimized verify function. 
   But, because each application's requirements are different, you might 
   want to construct your own verify function. Simple verify functions 
   are easily constructed using Clipper's AT() function, or they can 
   become complex if you implement more complicated search strategies 
   using logical operations like .NOT.. If you find yourself having 
   trouble constructing an alternate or additional verify function for 
   your application, please feel free to contact Index Applications for 
   assistance.

   CftsVeri() is used to confirm that each identified text record does 
   actually contain the search string(s). It is an optimized string 
   search comparing the source text with the target string(s). It returns 
   a 1 if successful and a zero if not.

   CftsVeri() offers four different types of verification:
   
   1 - Compare the search string with the beginning of the source text.
   2 - Compare the search string with the end of the source text. 
   3 - Interpret spaces between strings as logical ANDs and verify their 
       occurrence anywhere, in any order within the source text. 
   4 - Interpret the entire search criteria as a phrase and verify its 
       occurrence in the source text with exact word order matched.

   Although these four options, especially 3 and 4, will be sufficient in 
   most situations, it is possible, and in some cases preferable, to 
   create your own verify function. Here is where case sensitivity can be 
   reintroduced to a search. Once a text record has been identified by 
   CftsNext(), it can be inspected by a function to determine if the 
   search string is present and if case is matched. The user might be 
   able to toggle between two or more verification routines to perform 
   various kinds of searches. See BIB.PRG. Whatever verification 
   operation is done, it will not be as time consuming as it would be 
   otherwise because it will usually involve only a small subset of the 
   total number of records.


See Also: CftsVeri()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson