The way of calling the function cmph_search was fixed in the file README.t2t
This commit is contained in:
parent
1eac6fe727
commit
2a1914c0d8
@ -1 +0,0 @@
|
|||||||
<a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=96251&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /> </a>
|
|
58
README
58
README
@ -2,14 +2,17 @@ CMPH - C Minimal Perfect Hashing Library
|
|||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Description
|
|
||||||
|
Description
|
||||||
|
===========
|
||||||
|
|
||||||
C Minimal Perfect Hashing Library is a portable LGPLed library to create and
|
C Minimal Perfect Hashing Library is a portable LGPLed library to create and
|
||||||
to work with minimal perfect hashing functions. The cmph library encapsulates the newest
|
to work with minimal perfect hash functions (concepts.html).
|
||||||
|
The cmph library encapsulates the newest
|
||||||
and more efficient algorithms (available in the literature) in an easy-to-use,
|
and more efficient algorithms (available in the literature) in an easy-to-use,
|
||||||
production-quality and fast API. The library is designed to work with big entries that
|
production-quality and fast API. The library is designed to work with big entries that
|
||||||
can not fit in the main memory. It has been used successfully for constructing minimal perfect
|
can not fit in the main memory. It has been used successfully for constructing minimal perfect
|
||||||
hashing functions for sets with more than 100 million of keys.
|
hash functions for sets with more than 100 million of keys.
|
||||||
Although there is a lack of similar libraries
|
Although there is a lack of similar libraries
|
||||||
in the free software world (gperf is a bit different (gperf.html)), we can point out some
|
in the free software world (gperf is a bit different (gperf.html)), we can point out some
|
||||||
of the distinguishable features of cmph:
|
of the distinguishable features of cmph:
|
||||||
@ -27,7 +30,9 @@ of the distinguishable features of cmph:
|
|||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
Supported Algorithms
|
|
||||||
|
Supported Algorithms
|
||||||
|
====================
|
||||||
|
|
||||||
- BMZ Algorithm.
|
- BMZ Algorithm.
|
||||||
A very fast algorithm based on cyclic random graphs to construct minimal
|
A very fast algorithm based on cyclic random graphs to construct minimal
|
||||||
@ -40,15 +45,18 @@ Supported Algorithms
|
|||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
News for version 0.3
|
|
||||||
|
News for version 0.3
|
||||||
|
====================
|
||||||
|
|
||||||
- New heuristic added to the bmz algorithm permits to generate a mphf with only
|
- New heuristic added to the bmz algorithm permits to generate a mphf with only
|
||||||
24.61*n + O(1) bytes. The resulting function can be stored in 3.72*n bytes.
|
24.80n + O(1) bytes. The resulting function can be stored in 3.72n bytes.
|
||||||
click here (bmz.html) for details.
|
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
Examples
|
|
||||||
|
Examples
|
||||||
|
========
|
||||||
|
|
||||||
Using cmph is quite simple. Take a look.
|
Using cmph is quite simple. Take a look.
|
||||||
|
|
||||||
@ -62,14 +70,14 @@ Using cmph is quite simple. Take a look.
|
|||||||
//Fill vector
|
//Fill vector
|
||||||
//...
|
//...
|
||||||
|
|
||||||
//Create minimal perfect hashing function using the default(chm) algorithm.
|
//Create minimal perfect hash function using the default(chm) algorithm.
|
||||||
cmph_config_t *config = cmph_config_new(cmph_io_vector_adapter(vector, nkeys));
|
cmph_config_t *config = cmph_config_new(cmph_io_vector_adapter(vector, nkeys));
|
||||||
cmph_t *hash = cmph_new(config);
|
cmph_t *hash = cmph_new(config);
|
||||||
cmph_config_destroy(config);
|
cmph_config_destroy(config);
|
||||||
|
|
||||||
//Find key
|
//Find key
|
||||||
const char *key = "sample key";
|
const char *key = "sample key";
|
||||||
unsigned int id = cmph_search(hash, key);
|
unsigned int id = cmph_search(hash, key, strlen(key));
|
||||||
|
|
||||||
//Destroy hash
|
//Destroy hash
|
||||||
cmph_destroy(hash);
|
cmph_destroy(hash);
|
||||||
@ -94,21 +102,23 @@ Using cmph is quite simple. Take a look.
|
|||||||
|
|
||||||
//Find key
|
//Find key
|
||||||
const char *key = "sample key";
|
const char *key = "sample key";
|
||||||
unsigned int id = cmph_search(hash, key);
|
unsigned int id = cmph_search(hash, key, strlen(key));
|
||||||
|
|
||||||
//Destroy hash
|
//Destroy hash
|
||||||
cmph_destroy(hash);
|
cmph_destroy(hash);
|
||||||
|
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
|
|
||||||
The cmph application
|
|
||||||
|
The cmph application
|
||||||
|
====================
|
||||||
|
|
||||||
cmph is the name of both the library and the utility
|
cmph is the name of both the library and the utility
|
||||||
application that comes with this package. You can use the cmph
|
application that comes with this package. You can use the cmph
|
||||||
application for constructing minimal perfect hashing functions from the command line.
|
application for constructing minimal perfect hash functions from the command line.
|
||||||
The cmph utility
|
The cmph utility
|
||||||
comes with a number of flags, but it is very simple to create and to query
|
comes with a number of flags, but it is very simple to create and to query
|
||||||
minimal perfect hashing functions:
|
minimal perfect hash functions:
|
||||||
|
|
||||||
|
|
||||||
$ # Using the chm algorithm (default one) for constructing a mphf for keys in file keys_file
|
$ # Using the chm algorithm (default one) for constructing a mphf for keys in file keys_file
|
||||||
@ -133,9 +143,7 @@ utility.
|
|||||||
-f hash function (may be used multiple times) - valid values are
|
-f hash function (may be used multiple times) - valid values are
|
||||||
* djb2
|
* djb2
|
||||||
* fnv
|
* fnv
|
||||||
* glib
|
|
||||||
* jenkins
|
* jenkins
|
||||||
* pjw
|
|
||||||
* sdbm
|
* sdbm
|
||||||
-V print version number and exit
|
-V print version number and exit
|
||||||
-v increase verbosity (may be used multiple times)
|
-v increase verbosity (may be used multiple times)
|
||||||
@ -146,15 +154,21 @@ utility.
|
|||||||
keysfile line separated file with keys
|
keysfile line separated file with keys
|
||||||
|
|
||||||
|
|
||||||
Additional Documentation
|
|
||||||
|
Additional Documentation
|
||||||
|
========================
|
||||||
|
|
||||||
FAQ (faq.html)
|
FAQ (faq.html)
|
||||||
|
|
||||||
Downloads
|
|
||||||
|
Downloads
|
||||||
|
=========
|
||||||
|
|
||||||
Use the project page at sourceforge: http://sf.net/projects/cmph
|
Use the project page at sourceforge: http://sf.net/projects/cmph
|
||||||
|
|
||||||
License Stuff
|
|
||||||
|
License Stuff
|
||||||
|
=============
|
||||||
|
|
||||||
Code is under the LGPL.
|
Code is under the LGPL.
|
||||||
|
|
||||||
@ -162,11 +176,11 @@ Code is under the LGPL.
|
|||||||
|
|
||||||
Enjoy!
|
Enjoy!
|
||||||
|
|
||||||
Davi de Castro Reis <davi (a) users sourceforge net>
|
Davi de Castro Reis (davi@users.sourceforge.net)
|
||||||
|
|
||||||
Fabiano Cupertino Botelho <fc_botelho (a) users sourceforge net>
|
Fabiano Cupertino Botelho (fc_botelho@users.sourceforge.net)
|
||||||
|
|
||||||
Last Updated: Thu Jan 27 10:54:36 2005
|
Last Updated: Thu Feb 17 13:09:55 2005
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ Using cmph is quite simple. Take a look.
|
|||||||
|
|
||||||
//Find key
|
//Find key
|
||||||
const char *key = "sample key";
|
const char *key = "sample key";
|
||||||
unsigned int id = cmph_search(hash, key);
|
unsigned int id = cmph_search(hash, key, strlen(key));
|
||||||
|
|
||||||
//Destroy hash
|
//Destroy hash
|
||||||
cmph_destroy(hash);
|
cmph_destroy(hash);
|
||||||
@ -107,7 +107,7 @@ Using cmph is quite simple. Take a look.
|
|||||||
|
|
||||||
//Find key
|
//Find key
|
||||||
const char *key = "sample key";
|
const char *key = "sample key";
|
||||||
unsigned int id = cmph_search(hash, key);
|
unsigned int id = cmph_search(hash, key, strlen(key));
|
||||||
|
|
||||||
//Destroy hash
|
//Destroy hash
|
||||||
cmph_destroy(hash);
|
cmph_destroy(hash);
|
||||||
|
2
gendocs
2
gendocs
@ -4,6 +4,7 @@ txt2tags -t html -i CHM.t2t -o chm.html
|
|||||||
txt2tags -t html -i COMPARISON.t2t -o comparison.html
|
txt2tags -t html -i COMPARISON.t2t -o comparison.html
|
||||||
txt2tags -t html -i GPERF.t2t -o gperf.html
|
txt2tags -t html -i GPERF.t2t -o gperf.html
|
||||||
txt2tags -t html -i FAQ.t2t -o faq.html
|
txt2tags -t html -i FAQ.t2t -o faq.html
|
||||||
|
txt2tags -t html -i CONCEPTS.t2t -o concepts.html
|
||||||
|
|
||||||
txt2tags -t txt --mask-email -i README.t2t -o README
|
txt2tags -t txt --mask-email -i README.t2t -o README
|
||||||
txt2tags -t txt -i BMZ.t2t -o BMZ
|
txt2tags -t txt -i BMZ.t2t -o BMZ
|
||||||
@ -11,3 +12,4 @@ txt2tags -t txt -i CHM.t2t -o CHM
|
|||||||
txt2tags -t txt -i COMPARISON.t2t -o COMPARISON
|
txt2tags -t txt -i COMPARISON.t2t -o COMPARISON
|
||||||
txt2tags -t txt -i GPERF.t2t -o GPERF
|
txt2tags -t txt -i GPERF.t2t -o GPERF
|
||||||
txt2tags -t txt -i FAQ.t2t -o FAQ
|
txt2tags -t txt -i FAQ.t2t -o FAQ
|
||||||
|
txt2tags -t txt -i CONCEPTS.t2t -o CONCEPTS
|
||||||
|
Loading…
Reference in New Issue
Block a user