# Path: taglexicon.py
# def hash32trans(s):
#     return fasthash.hashlongs32(tuple(ord(c) for c in s))
# 
# def hash64trans(s):
#     return fasthash.hashlongs64(tuple(ord(c) for c in s))
# 
# Path: form.py
# class Lookup(Form):
#     def __init__(self, parent, wclexicon):
#         self.parent = parent
#         self.wclexicon = wclexicon
# 
#     def get_wclexicon(self):
#         return self.wclexicon


from math import ceil, log2
from taglexicon import hash32trans, hash64trans
from fasthash import hash32, hash64
from form import Lookup


class WCLexicon:
    def __init__(self, name, items, config):
        config.wclexicons.append(self)

        self.items = items
        self.lower = False
        self.name = name
        self.config = config

        self.c_size = '%s_size' % name
        self.c_table = name

    def make_table(self):
        n_items = len(self.items)
        size = 1 << (ceil(log2(n_items) + 0.5))
        table = [None] * size
        if self.lower:

# Path: taglexicon.py
# def hash32trans(s):
#     return fasthash.hashlongs32(tuple(ord(c) for c in s))
# 
# def hash64trans(s):
#     return fasthash.hashlongs64(tuple(ord(c) for c in s))
# 
# Path: form.py
# class Lookup(Form):
#     def __init__(self, parent, wclexicon):
#         self.parent = parent
#         self.wclexicon = wclexicon
# 
#     def get_wclexicon(self):
#         return self.wclexicon


# Path: wclexicon.py
from math import ceil, log2
from taglexicon import hash32trans, hash64trans
from fasthash import hash32, hash64
from form import Lookup



class WCLexicon:
    def __init__(self, name, items, config):
        config.wclexicons.append(self)

        self.items = items
        self.lower = False
        self.name = name
        self.config = config

        self.c_size = '%s_size' % name
        self.c_table = name

    def make_table(self):
        n_items = len(self.items)
        size = 1 << (ceil(log2(n_items) + 0.5))
        table = [None] * size
        if self.lower:

            fun = (lambda s: hash32trans(s.lower())) \