You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
738 B

4 years ago
  1. from libc.stdint cimport int64_t
  2. from libcpp.vector cimport vector
  3. from libcpp.set cimport set
  4. from cymem.cymem cimport Pool
  5. from preshed.maps cimport PreshMap
  6. from murmurhash.mrmr cimport hash64
  7. from .typedefs cimport attr_t, hash_t
  8. cpdef hash_t hash_string(unicode string) except 0
  9. cdef hash_t hash_utf8(char* utf8_string, int length) nogil
  10. cdef unicode decode_Utf8Str(const Utf8Str* string)
  11. ctypedef union Utf8Str:
  12. unsigned char[8] s
  13. unsigned char* p
  14. cdef class StringStore:
  15. cdef Pool mem
  16. cdef vector[hash_t] keys
  17. cdef set[hash_t] hits
  18. cdef public PreshMap _map
  19. cdef const Utf8Str* intern_unicode(self, unicode py_string)
  20. cdef const Utf8Str* _intern_utf8(self, char* utf8_string, int length)