Skip to content

Commit

Permalink
bundle hat-trie
Browse files Browse the repository at this point in the history
  • Loading branch information
kmike committed Jul 19, 2012
0 parents commit 8aa3845
Show file tree
Hide file tree
Showing 29 changed files with 2,271 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
^build
^MANIFEST$
^dist
\.so$
\.o$
\.lo$

^stuff/
\.rej$
\.pyc$
^.tox
\.orig$
\.prof$
\.coverage$
\.git
18 changes: 18 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright (c) Mikhail Korobov, 2012

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR
A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14 changes: 14 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
include README.rst
include CHANGES.rst
include LICENSE
include tox.ini
include update_c.sh

recursive-include hat-trie/src *.h *.c
include hat-trie/src/config.h.in
include hat-trie/configure
include hat-trie/configure.ac

include src/hat_trie.pyx
include src/chat_datrie.pxd

19 changes: 19 additions & 0 deletions hat-trie/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (C) 2011 by Daniel C. Jones <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN

8 changes: 8 additions & 0 deletions hat-trie/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

SUBDIRS = src test

EXTRA_DIST = README.md COPYING

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = hat-trie-0.1.pc

34 changes: 34 additions & 0 deletions hat-trie/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

Hat-Trie
========

This a ANSI C99 implementation of the HAT-trie data structure of Askitis and
Sinha, an extremely efficient (space and time) modern variant of tries.

The version implemented here maps arrays of bytes to words (i.e., unsigned
longs), which can be used to store counts, pointers, etc, or not used at all if
you simply want to maintain a set of unique strings.

For details see,

1. Askitis, N., & Sinha, R. (2007). HAT-trie: a cache-conscious trie-based data
structure for strings. Proceedings of the thirtieth Australasian conference on
Computer science-Volume 62 (pp. 97–105). Australian Computer Society, Inc.

2. Askitis, N., & Zobel, J. (2005). Cache-conscious collision resolution in
string hash tables. String Processing and Information Retrieval (pp.
91–102). Springer.


Installation
------------

git clone [email protected]:dcjones/hat-trie.git
cd hat-trie
autoreconf -i
./configure
make install

To use the library, include `hat-trie.h` and link using `lhat-trie`.


6 changes: 6 additions & 0 deletions hat-trie/TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

todo:
* Deletion in ahtable.
* Deletion in hattrie.


39 changes: 39 additions & 0 deletions hat-trie/configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

AC_INIT([hat-trie], [0.1.0], [[email protected]])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_HEADERS([config.h])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

base_CFLAGS="-std=c99 -Wall -Wextra -pedantic"
opt_CFLAGS="${base_CFLAGS} -O3"
dbg_CFLAGS="${base_CFLAGS} -g -O0"

AC_ARG_ENABLE([debugging],
[AS_HELP_STRING([--enable-debugging],
[enable debugging info (default is no)])],
[], [enable_debugging=no])

AS_IF([test "x$enable_debugging" = xyes],
[CFLAGS="$dbg_CFLAGS"],
[CFLAGS="$opt_CFLAGS"])


AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_DISABLE_SHARED
AC_PROG_LIBTOOL

AC_C_BIGENDIAN([AC_MSG_ERROR([Big-endian systems are not currently supported.])])
AC_CHECK_HEADERS([stdint.h stdlib.h])
AC_HEADER_STDBOOL
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T

AC_CONFIG_FILES([hat-trie-0.1.pc Makefile src/Makefile test/Makefile])
AC_OUTPUT

12 changes: 12 additions & 0 deletions hat-trie/hat-trie-0.1.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: @PACKAGE_NAME@
Description: An efficient trie implementation.
Version: @PACKAGE_VERSION@
Cflags: -I{includedir}
Libs: -L${libdir}

11 changes: 11 additions & 0 deletions hat-trie/src/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

lib_LTLIBRARIES = libhat-trie.la

libhat_trie_la_SOURCES = common.h \
ahtable.h ahtable.c \
hat-trie.h hat-trie.c \
misc.h misc.c \
superfasthash.h superfasthash.c

pkginclude_HEADERS = hat-trie.h ahtable.h common.h

Loading

0 comments on commit 8aa3845

Please sign in to comment.