github.com/andy2046/gopie@v0.7.0/pkg/hyperloglog/hyperloglog_test.go (about)

     1  package hyperloglog
     2  
     3  import (
     4  	"math"
     5  	"testing"
     6  )
     7  
     8  var words = []string{
     9  	"aardvark", "abyssinian", "accelerator",
    10  	"accordion", "account", "accountant", "acknowledgment",
    11  	"acoustic", "acrylic", "act", "action", "active", "activity",
    12  	"actor", "actress", "adapter", "addition", "address",
    13  	"adjustment", "adult", "advantage", "advertisement", "advice",
    14  	"afghanistan", "africa", "aftermath", "afternoon",
    15  	"aftershave", "afterthought", "age", "agenda", "agreement",
    16  	"air", "airbus", "airmail", "airplane", "airport", "airship",
    17  	"alarm", "albatross", "alcohol", "algebra", "algeria",
    18  	"alibi", "alley", "alligator", "alloy", "almanac", "alphabet",
    19  	"alto", "aluminium", "aluminum", "ambulance", "america",
    20  	"amount", "amusement", "anatomy", "anethesiologist", "anger",
    21  	"angle", "angora", "animal", "anime", "ankle", "answer",
    22  	"ant", "antarctica", "anteater", "antelope", "anthony",
    23  	"anthropology", "apartment", "apology", "apparatus",
    24  	"apparel", "appeal", "appendix", "apple", "appliance",
    25  	"approval", "april", "aquarius", "arch", "archaeology",
    26  	"archeology", "archer", "architecture", "area", "argentina",
    27  	"argument", "aries", "arithmetic", "arm", "armadillo",
    28  	"armchair", "armenian", "army", "arrow", "art", "ash",
    29  	"ashtray", "asia", "asparagus", "asphalt", "asterisk",
    30  	"astronomy", "athlete", "atm", "atom", "attack", "attempt",
    31  	"attention", "attic", "attraction", "august", "aunt",
    32  	"australia", "australian", "author", "authorisation",
    33  	"authority", "authorization", "avenue", "babies", "baboon",
    34  	"baby", "back", "backbone", "bacon", "badge", "badger", "bag",
    35  	"bagel", "bagpipe", "bail", "bait", "baker", "bakery",
    36  	"balance", "balinese", "ball", "balloon", "bamboo", "banana",
    37  	"band", "bandana", "bangladesh", "bangle", "banjo", "bank",
    38  	"bankbook", "banker", "bar", "barbara", "barber", "barge",
    39  	"baritone", "barometer", "base", "baseball", "basement",
    40  	"basin", "basket", "basketball", "bass", "bassoon", "bat",
    41  	"bath", "bathroom", "bathtub", "battery", "battle", "bay",
    42  	"beach", "bead", "beam", "bean", "bear", "beard", "beast",
    43  	"beat", "beautician", "beauty", "beaver", "bed", "bedroom",
    44  	"bee", "beech", "beef", "beer", "beet", "beetle", "beggar",
    45  	"beginner", "begonia", "behavior", "belgian", "belief",
    46  	"believe", "bell", "belt", "bench", "bengal", "beret",
    47  	"berry", "bestseller", "betty", "bibliography", "bicycle",
    48  	"bike", "bill", "billboard", "biology", "biplane", "birch",
    49  	"bird", "birth", "birthday", "bit", "bite", "black",
    50  	"bladder", "blade", "blanket", "blinker", "blizzard", "block",
    51  	"blood", "blouse", "blow", "blowgun", "blue", "board", "boat",
    52  	"bobcat", "body", "bolt", "bomb", "bomber", "bone", "bongo",
    53  	"bonsai", "book", "bookcase", "booklet", "boot", "border",
    54  	"botany", "bottle", "bottom", "boundary", "bow", "bowl",
    55  	"bowling", "box", "boy", "bra", "brace", "bracket", "brain",
    56  	"brake", "branch", "brand", "brandy", "brass", "brazil",
    57  	"bread", "break", "breakfast", "breath", "brian", "brick",
    58  	"bridge", "british", "broccoli", "brochure", "broker",
    59  	"bronze", "brother", "brother-in-law", "brow", "brown",
    60  	"brush", "bubble", "bucket", "budget", "buffer", "buffet",
    61  	"bugle", "building", "bulb", "bull", "bulldozer", "bumper",
    62  	"bun", "burglar", "burma", "burn", "burst", "bus", "bush",
    63  	"business", "butane", "butcher", "butter", "button",
    64  	"buzzard", "cabbage", "cabinet", "cable", "cactus", "cafe",
    65  	"cake", "calculator", "calculus", "calendar", "calf", "call",
    66  	"camel", "camera", "camp", "can", "canada", "canadian",
    67  	"cancer", "candle", "cannon", "canoe", "canvas", "cap",
    68  	"capital", "cappelletti", "capricorn", "captain", "caption",
    69  	"car", "caravan", "carbon", "card", "cardboard", "cardigan",
    70  	"care", "carnation", "carol", "carp", "carpenter", "carriage",
    71  	"carrot", "cart", "cartoon", "case", "cast", "castanet",
    72  	"cat", "catamaran", "caterpillar", "cathedral", "catsup",
    73  	"cattle", "cauliflower", "cause", "caution", "cave",
    74  	"c-clamp", "cd", "ceiling", "celery", "celeste", "cell",
    75  	"cellar", "cello", "celsius", "cement", "cemetery", "cent",
    76  	"centimeter", "century", "ceramic", "cereal", "certification",
    77  	"chain", "chair", "chalk", "chance", "change", "channel",
    78  	"character", "chard", "charles", "chauffeur", "check",
    79  	"cheek", "cheese", "cheetah", "chef", "chemistry", "cheque",
    80  	"cherries", "cherry", "chess", "chest", "chick", "chicken",
    81  	"chicory", "chief", "child", "children", "chill", "chime",
    82  	"chimpanzee", "chin", "china", "chinese", "chive",
    83  	"chocolate", "chord", "christmas", "christopher",
    84  	"chronometer", "church", "cicada", "cinema", "circle",
    85  	"circulation", "cirrus", "citizenship", "city", "clam",
    86  	"clarinet", "class", "claus", "clave", "clef", "clerk",
    87  	"click", "client", "climb", "clipper", "cloakroom", "clock",
    88  	"close", "closet", "cloth", "cloud", "cloudy", "clover",
    89  	"club", "clutch", "coach", "coal", "coast", "coat", "cobweb",
    90  	"cockroach", "cocktail", "cocoa", "cod", "coffee", "coil",
    91  	"coin", "coke", "cold", "collar", "college", "collision",
    92  	"colombia", "colon", "colony", "color", "colt", "column",
    93  	"columnist", "comb", "comfort", "comic", "comma", "command",
    94  	"commission", "committee", "community", "company",
    95  	"comparison", "competition", "competitor", "composer",
    96  	"composition", "computer", "condition", "condor", "cone",
    97  	"confirmation", "conga", "congo", "conifer", "connection",
    98  	"consonant", "continent", "control", "cook", "cooking",
    99  	"copper", "copy", "copyright", "cord", "cork", "cormorant",
   100  	"corn", "cornet", "correspondent", "cost", "cotton", "couch",
   101  	"cougar", "cough", "country", "course", "court", "cousin",
   102  	"cover", "cow", "cowbell", "crab", "crack", "cracker",
   103  	"craftsman", "crate", "crawdad", "crayfish", "crayon",
   104  	"cream", "creator", "creature", "credit", "creditor", "creek",
   105  	"crib", "cricket", "crime", "criminal", "crocodile", "crocus",
   106  	"croissant", "crook", "crop", "cross", "crow", "crowd",
   107  	"crown", "crush", "cry", "cub", "cuban", "cucumber",
   108  	"cultivator", "cup", "cupboard", "cupcake", "curler",
   109  	"currency", "current", "curtain", "curve", "cushion",
   110  	"custard", "customer", "cut", "cuticle", "cycle", "cyclone",
   111  	"cylinder", "cymbal", "dad", "daffodil", "dahlia", "daisy",
   112  	"damage", "dance", "dancer", "danger", "daniel", "dash",
   113  	"dashboard", "database", "date", "daughter", "david", "day",
   114  	"dead", "deadline", "deal", "death", "deborah", "debt",
   115  	"debtor", "decade", "december", "decimal", "decision",
   116  	"decrease", "dedication", "deer", "defense", "deficit",
   117  	"degree", "delete", "delivery", "den", "denim", "dentist",
   118  	"deodorant", "department", "deposit", "description", "desert",
   119  	"design", "desire", "desk", "dessert", "destruction",
   120  	"detail", "detective", "development", "dew", "diamond",
   121  	"diaphragm", "dibble", "dictionary", "dietician",
   122  	"difference", "digestion", "digger", "digital", "dill",
   123  	"dime", "dimple", "dinghy", "dinner", "dinosaur", "diploma",
   124  	"dipstick", "direction", "dirt", "disadvantage", "discovery",
   125  	"discussion", "disease", "disgust", "dish", "distance",
   126  	"distribution", "distributor", "diving", "division",
   127  	"divorced", "dock", "doctor", "dog", "dogsled", "doll",
   128  	"dollar", "dolphin", "domain", "donald", "donkey", "donna",
   129  	"door", "dorothy", "double", "doubt", "downtown", "dragon",
   130  	"dragonfly", "drain", "drake", "drama", "draw", "drawbridge",
   131  	"drawer", "dream", "dredger", "dress", "dresser", "dressing",
   132  	"drill", "drink", "drive", "driver", "driving", "drizzle",
   133  	"drop", "drug", "drum", "dry", "dryer", "duck", "duckling",
   134  	"dugout", "dungeon", "dust", "eagle", "ear", "earth",
   135  	"earthquake", "ease", "east", "edge", "edger", "editor",
   136  	"editorial", "education", "edward", "eel", "effect", "egg",
   137  	"eggnog", "eggplant", "egypt", "eight", "elbow", "element",
   138  	"elephant", "elizabeth", "ellipse", "emery", "employee",
   139  	"employer", "encyclopedia", "end", "enemy", "energy",
   140  	"engine", "engineer", "engineering", "english", "enquiry",
   141  	"entrance", "environment", "epoch", "epoxy", "equinox",
   142  	"equipment", "era", "error", "estimate", "ethernet",
   143  	"ethiopia", "euphonium", "europe", "evening", "event",
   144  	"examination", "example", "exchange", "exclamation",
   145  	"exhaust", "ex-husband", "existence", "expansion",
   146  	"experience", "expert", "explanation", "ex-wife", "eye",
   147  	"eyebrow", "eyelash", "eyeliner", "face", "facilities",
   148  	"fact", "factory", "fahrenheit", "fairies", "fall", "family",
   149  	"fan", "fang", "farm", "farmer", "fat", "father",
   150  	"father-in-law", "faucet", "fear", "feast", "feather",
   151  	"feature", "february", "fedelini", "feedback", "feeling",
   152  	"feet", "felony", "female", "fender", "ferry", "ferryboat",
   153  	"fertilizer", "fiber", "fiberglass", "fibre", "fiction",
   154  	"field", "fifth", "fight", "fighter", "file", "find", "fine",
   155  	"finger", "fir", "fire", "fired", "fireman", "fireplace",
   156  	"firewall", "fish", "fisherman", "flag", "flame", "flare",
   157  	"flat", "flavor", "flax", "flesh", "flight", "flock", "flood",
   158  	"floor", "flower", "flugelhorn", "flute", "fly", "foam",
   159  	"fog", "fold", "font", "food", "foot", "football", "footnote",
   160  	"force", "forecast", "forehead", "forest", "forgery", "fork",
   161  	"form", "format", "fortnight", "foundation", "fountain",
   162  	"fowl", "fox", "foxglove", "fragrance", "frame", "france",
   163  	"freckle", "freeze", "freezer", "freighter", "french",
   164  	"freon", "friction", "friday", "fridge", "friend", "frog",
   165  	"front", "frost", "frown", "fruit", "fuel", "fur",
   166  	"furniture", "galley", "gallon", "game", "gander", "garage",
   167  	"garden", "garlic", "gas", "gasoline", "gate", "gateway",
   168  	"gauge", "gazelle", "gear", "gearshift", "geese", "gemini",
   169  	"gender", "geography", "geology", "geometry", "george",
   170  	"geranium", "german", "germany", "ghana", "ghost", "giant",
   171  	"giraffe", "girdle", "girl", "gladiolus", "glass", "glider",
   172  	"gliding", "glockenspiel", "glove", "glue", "goal", "goat",
   173  	"gold", "goldfish", "golf", "gondola", "gong", "good-bye",
   174  	"goose", "gore-tex", "gorilla", "gosling", "government",
   175  	"governor", "grade", "grain", "gram", "granddaughter",
   176  	"grandfather", "grandmother", "grandson", "grape", "graphic",
   177  	"grass", "grasshopper", "gray", "grease", "great-grandfather",
   178  	"great-grandmother", "greece", "greek", "green", "grenade",
   179  	"grey", "grill", "grip", "ground", "group", "grouse",
   180  	"growth", "guarantee", "guatemalan", "guide", "guilty",
   181  	"guitar", "gum", "gun", "gym", "gymnast", "hacksaw", "hail",
   182  	"hair", "haircut", "half-brother", "half-sister", "halibut",
   183  	"hall", "hallway", "hamburger", "hammer", "hamster", "hand",
   184  	"handball", "handicap", "handle", "handsaw", "harbor",
   185  	"hardboard", "hardcover", "hardhat", "hardware", "harmonica",
   186  	"harmony", "harp", "hat", "hate", "hawk", "head", "headlight",
   187  	"headline", "health", "hearing", "heart", "heat", "heaven",
   188  	"hedge", "height", "helen", "helicopter", "helium", "hell",
   189  	"helmet", "help", "hemp", "hen", "heron", "herring",
   190  	"hexagon", "hill", "himalayan", "hip", "hippopotamus",
   191  	"history", "hobbies", "hockey", "hoe", "hole", "holiday",
   192  	"home", "honey", "hood", "hook", "hope", "horn", "horse",
   193  	"hose", "hospital", "hot", "hour", "hourglass", "house",
   194  	"hovercraft", "hub", "hubcap", "humidity", "humor",
   195  	"hurricane", "hyacinth", "hydrant", "hydrofoil", "hydrogen",
   196  	"hyena", "hygienic", "ice", "icebreaker", "icicle", "icon",
   197  	"idea", "ikebana", "illegal", "imprisonment", "improvement",
   198  	"impulse", "inch", "income", "increase", "index", "india",
   199  	"indonesia", "industry", "ink", "innocent", "input", "insect",
   200  	"instruction", "instrument", "insulation", "insurance",
   201  	"interactive", "interest", "internet", "interviewer",
   202  	"intestine", "invention", "inventory", "invoice", "iran",
   203  	"iraq", "iris", "iron", "island", "israel", "italian",
   204  	"italy", "jacket", "jaguar", "jail", "jam", "james",
   205  	"january", "japan", "japanese", "jar", "jasmine", "jason",
   206  	"jaw", "jeans", "jeep", "jeff", "jelly", "jellyfish",
   207  	"jennifer", "jet", "jewel", "jogging", "john", "join", "joke",
   208  	"joseph", "journey", "judge", "judo", "juice", "july",
   209  	"jumbo", "jump", "jumper", "june", "jury", "justice", "jute",
   210  	"kale", "kamikaze", "kangaroo", "karate", "karen", "kayak",
   211  	"kendo", "kenneth", "kenya", "ketchup", "kettle",
   212  	"kettledrum", "kevin", "key", "keyboard", "keyboarding",
   213  	"kick", "kidney", "kilogram", "kilometer", "kimberly", "kiss",
   214  	"kitchen", "kite", "kitten", "kitty", "knee", "knickers",
   215  	"knife", "knight", "knot", "knowledge", "kohlrabi", "korean",
   216  	"laborer", "lace", "ladybug", "lake", "lamb", "lamp", "lan",
   217  	"land", "landmine", "language", "larch", "lasagna", "latency",
   218  	"latex", "lathe", "laugh", "laundry", "laura", "law",
   219  	"lawyer", "layer", "lead", "leaf", "learning", "leather",
   220  	"leek", "leg", "legal", "lemonade", "lentil", "leo",
   221  	"leopard", "letter", "lettuce", "level", "libra", "library",
   222  	"license", "lier", "lift", "light", "lightning", "lilac",
   223  	"lily", "limit", "linda", "line", "linen", "link", "lion",
   224  	"lip", "lipstick", "liquid", "liquor", "lisa", "list",
   225  	"literature", "litter", "liver", "lizard", "llama", "loaf",
   226  	"loan", "lobster", "lock", "locket", "locust", "look", "loss",
   227  	"lotion", "love", "low", "lumber", "lunch", "lunchroom",
   228  	"lung", "lunge", "lute", "luttuce", "lycra", "lynx",
   229  	"lyocell", "lyre", "lyric", "macaroni", "machine", "macrame",
   230  	"magazine", "magic", "magician", "maid", "mail", "mailbox",
   231  	"mailman", "makeup", "malaysia", "male", "mall", "mallet",
   232  	"man", "manager", "mandolin", "manicure", "manx", "map",
   233  	"maple", "maraca", "marble", "march", "margaret", "margin",
   234  	"maria", "marimba", "mark", "mark", "market", "married",
   235  	"mary", "mascara", "mask", "mass", "match", "math", "mattock",
   236  	"may", "mayonnaise", "meal", "measure", "meat", "mechanic",
   237  	"medicine", "meeting", "melody", "memory", "men", "menu",
   238  	"mercury", "message", "metal", "meteorology", "meter",
   239  	"methane", "mexican", "mexico", "mice", "michael", "michelle",
   240  	"microwave", "middle", "mile", "milk", "milkshake",
   241  	"millennium", "millimeter", "millisecond", "mimosa", "mind",
   242  	"mine", "minibus", "mini-skirt", "minister", "mint", "minute",
   243  	"mirror", "missile", "mist", "mistake", "mitten", "moat",
   244  	"modem", "mole", "mom", "monday", "money", "monkey", "month",
   245  	"moon", "morning", "morocco", "mosque", "mosquito", "mother",
   246  	"mother-in-law", "motion", "motorboat", "motorcycle",
   247  	"mountain", "mouse", "moustache", "mouth", "move",
   248  	"multi-hop", "multimedia", "muscle", "museum", "music",
   249  	"musician", "mustard", "myanmar", "nail", "name", "nancy",
   250  	"napkin", "narcissus", "nation", "neck", "need", "needle",
   251  	"neon", "nepal", "nephew", "nerve", "nest", "net", "network",
   252  	"news", "newsprint", "newsstand", "nic", "nickel", "niece",
   253  	"nigeria", "night", "nitrogen", "node", "noise", "noodle",
   254  	"north", "north america", "north korea", "norwegian", "nose",
   255  	"note", "notebook", "notify", "novel", "november", "number",
   256  	"numeric", "nurse", "nut", "nylon", "oak", "oatmeal",
   257  	"objective", "oboe", "observation", "occupation", "ocean",
   258  	"ocelot", "octagon", "octave", "october", "octopus",
   259  	"odometer", "offence", "offer", "office", "oil", "okra",
   260  	"olive", "onion", "open", "opera", "operation",
   261  	"ophthalmologist", "opinion", "option", "orange", "orchestra",
   262  	"orchid", "order", "organ", "organisation", "organization",
   263  	"ornament", "ostrich", "otter", "ounce", "output",
   264  	"outrigger", "oval", "oven", "overcoat", "owl", "owner", "ox",
   265  	"oxygen", "oyster", "package", "packet", "page", "pail",
   266  	"pain", "paint", "pair", "pajama", "pakistan", "palm",
   267  	"pamphlet", "pan", "pancake", "pancreas", "panda", "pansy",
   268  	"panther", "panties", "pantry", "pants", "panty", "pantyhose",
   269  	"paper", "paperback", "parade", "parallelogram", "parcel",
   270  	"parent", "parentheses", "park", "parrot", "parsnip", "part",
   271  	"particle", "partner", "partridge", "party", "passbook",
   272  	"passenger", "passive", "pasta", "paste", "pastor", "pastry",
   273  	"patch", "path", "patient", "patio", "patricia", "paul",
   274  	"payment", "pea", "peace", "peak", "peanut", "pear",
   275  	"pedestrian", "pediatrician", "peen", "peer-to-peer",
   276  	"pelican", "pen", "penalty", "pencil", "pendulum", "pentagon",
   277  	"peony", "pepper", "perch", "perfume", "period", "periodical",
   278  	"peripheral", "permission", "persian", "person", "peru",
   279  	"pest", "pet", "pharmacist", "pheasant", "philippines",
   280  	"philosophy", "phone", "physician", "piano", "piccolo",
   281  	"pickle", "picture", "pie", "pig", "pigeon", "pike", "pillow",
   282  	"pilot", "pimple", "pin", "pine", "ping", "pink", "pint",
   283  	"pipe", "pisces", "pizza", "place", "plain", "plane",
   284  	"planet", "plant", "plantation", "plaster", "plasterboard",
   285  	"plastic", "plate", "platinum", "play", "playground",
   286  	"playroom", "pleasure", "plier", "plot", "plough", "plow",
   287  	"plywood", "pocket", "poet", "point", "poison", "poland",
   288  	"police", "policeman", "polish", "politician", "pollution",
   289  	"polo", "polyester", "pond", "popcorn", "poppy", "population",
   290  	"porch", "porcupine", "port", "porter", "position",
   291  	"possibility", "postage", "postbox", "pot", "potato",
   292  	"poultry", "pound", "powder", "power", "precipitation",
   293  	"preface", "prepared", "pressure", "price", "priest", "print",
   294  	"printer", "prison", "probation", "process", "processing",
   295  	"produce", "product", "production", "professor", "profit",
   296  	"promotion", "propane", "property", "prose", "prosecution",
   297  	"protest", "protocol", "pruner", "psychiatrist", "psychology",
   298  	"ptarmigan", "puffin", "pull", "puma", "pump", "pumpkin",
   299  	"punch", "punishment", "puppy", "purchase", "purple",
   300  	"purpose", "push", "pvc", "pyjama", "pyramid", "quail",
   301  	"quality", "quart", "quarter", "quartz", "queen", "question",
   302  	"quicksand", "quiet", "quill", "quilt", "quince", "quit",
   303  	"quiver", "quotation", "rabbi", "rabbit", "racing", "radar",
   304  	"radiator", "radio", "radish", "raft", "rail", "railway",
   305  	"rain", "rainbow", "raincoat", "rainstorm", "rake", "ramie",
   306  	"random", "range", "rat", "rate", "raven", "ravioli", "ray",
   307  	"rayon", "reaction", "reading", "reason", "receipt", "recess",
   308  	"record", "recorder", "rectangle", "red", "reduction",
   309  	"refrigerator", "refund", "regret", "reindeer", "relation",
   310  	"relative", "religion", "relish", "reminder", "repair",
   311  	"replace", "report", "representative", "request",
   312  	"resolution", "respect", "responsibility", "rest",
   313  	"restaurant", "result", "retailer", "revolve", "revolver",
   314  	"reward", "rhinoceros", "rhythm", "rice", "richard", "riddle",
   315  	"rifle", "ring", "rise", "risk", "river", "riverbed", "road",
   316  	"roadway", "roast", "robert", "robin", "rock", "rocket",
   317  	"rod", "roll", "romania", "romanian", "ronald", "roof",
   318  	"room", "rooster", "root", "rose", "rotate", "route",
   319  	"router", "rowboat", "rub", "rubber", "rugby", "rule", "run",
   320  	"russia", "russian", "rutabaga", "ruth", "sack",
   321  	"sagittarius", "sail", "sailboat", "sailor", "salad",
   322  	"salary", "sale", "salesman", "salmon", "salt", "sampan",
   323  	"samurai", "sand", "sandra", "sandwich", "santa", "sarah",
   324  	"sardine", "satin", "saturday", "sauce", "saudi arabia",
   325  	"sausage", "save", "saw", "saxophone", "scale", "scallion",
   326  	"scanner", "scarecrow", "scarf", "scene", "scent", "schedule",
   327  	"school", "science", "scissors", "scooter", "scorpio",
   328  	"scorpion", "scraper", "screen", "screw", "screwdriver",
   329  	"sea", "seagull", "seal", "seaplane", "search", "seashore",
   330  	"season", "seat", "second", "secretary", "secure", "security",
   331  	"seed", "seeder", "segment", "select", "selection", "self",
   332  	"semicircle", "semicolon", "sense", "sentence", "separated",
   333  	"september", "servant", "server", "session", "sex", "shade",
   334  	"shadow", "shake", "shallot", "shame", "shampoo", "shape",
   335  	"share", "shark", "sharon", "shears", "sheep", "sheet",
   336  	"shelf", "shell", "shield", "shingle", "ship", "shirt",
   337  	"shock", "shoe", "shoemaker", "shop", "shorts", "shoulder",
   338  	"shovel", "show", "shrimp", "shrine", "siamese", "siberian",
   339  	"side", "sideboard", "sidecar", "sidewalk", "sign",
   340  	"signature", "silica", "silk", "silver", "sing", "singer",
   341  	"single", "sink", "sister", "sister-in-law", "size", "skate",
   342  	"skiing", "skill", "skin", "skirt", "sky", "slash", "slave",
   343  	"sled", "sleep", "sleet", "slice", "slime", "slip", "slipper",
   344  	"slope", "smash", "smell", "smile", "smoke", "snail", "snake",
   345  	"sneeze", "snow", "snowboarding", "snowflake", "snowman",
   346  	"snowplow", "snowstorm", "soap", "soccer", "society",
   347  	"sociology", "sock", "soda", "sofa", "softball", "softdrink",
   348  	"software", "soil", "soldier", "son", "song", "soprano",
   349  	"sort", "sound", "soup", "sousaphone", "south africa", "south america",
   350  	"south korea", "soy", "soybean", "space", "spade",
   351  	"spaghetti", "spain", "spandex", "spark", "sparrow", "spear",
   352  	"specialist", "speedboat", "sphere", "sphynx", "spider",
   353  	"spike", "spinach", "spleen", "sponge", "spoon", "spot",
   354  	"spring", "sprout", "spruce", "spy", "square", "squash",
   355  	"squid", "squirrel", "stage", "staircase", "stamp", "star",
   356  	"start", "starter", "state", "statement", "station",
   357  	"statistic", "steam", "steel", "stem", "step", "step-aunt",
   358  	"step-brother", "stepdaughter", "step-daughter",
   359  	"step-father", "step-grandfather", "step-grandmother",
   360  	"stepmother", "step-mother", "step-sister", "stepson",
   361  	"step-son", "step-uncle", "steven", "stew", "stick",
   362  	"stinger", "stitch", "stock", "stocking", "stomach", "stone",
   363  	"stool", "stop", "stopsign", "stopwatch", "store", "storm",
   364  	"story", "stove", "stranger", "straw", "stream", "street",
   365  	"streetcar", "stretch", "string", "structure", "study",
   366  	"sturgeon", "submarine", "substance", "subway", "success",
   367  	"sudan", "suede", "sugar", "suggestion", "suit", "summer",
   368  	"sun", "sunday", "sundial", "sunflower", "sunshine",
   369  	"supermarket", "supply", "support", "surfboard", "surgeon",
   370  	"surname", "surprise", "susan", "sushi", "swallow", "swamp",
   371  	"swan", "sweater", "sweatshirt", "sweatshop", "swedish",
   372  	"sweets", "swim", "swimming", "swing", "swiss", "switch",
   373  	"sword", "swordfish", "sycamore", "syria", "syrup", "system",
   374  	"table", "tablecloth", "tabletop", "tachometer", "tadpole",
   375  	"tail", "tailor", "taiwan", "talk", "tank", "tanker",
   376  	"tanzania", "target", "taste", "taurus", "tax", "taxi",
   377  	"taxicab", "tea", "teacher", "teaching", "team", "technician",
   378  	"teeth", "television", "teller", "temper", "temperature",
   379  	"temple", "tempo", "tendency", "tennis", "tenor", "tent",
   380  	"territory", "test", "text", "textbook", "texture",
   381  	"thailand", "theater", "theory", "thermometer", "thing",
   382  	"thistle", "thomas", "thought", "thread", "thrill", "throat",
   383  	"throne", "thumb", "thunder", "thunderstorm", "thursday",
   384  	"ticket", "tie", "tiger", "tights", "tile", "timbale", "time",
   385  	"timer", "timpani", "tin", "tip", "tire", "titanium", "title",
   386  	"toad", "toast", "toe", "toenail", "toilet", "tomato",
   387  	"tom-tom", "ton", "tongue", "tooth", "toothbrush",
   388  	"toothpaste", "top", "tornado", "tortellini", "tortoise",
   389  	"touch", "tower", "town", "toy", "tractor", "trade",
   390  	"traffic", "trail", "train", "tramp", "transaction",
   391  	"transmission", "transport", "trapezoid", "tray", "treatment",
   392  	"tree", "trial", "triangle", "trick", "trigonometry", "trip",
   393  	"trombone", "trouble", "trousers", "trout", "trowel", "truck",
   394  	"trumpet", "trunk", "t-shirt", "tsunami", "tub", "tuba",
   395  	"tuesday", "tugboat", "tulip", "tuna", "tune", "turkey",
   396  	"turkey", "turkish", "turn", "turnip", "turnover", "turret",
   397  	"turtle", "tv", "twig", "twilight", "twine", "twist",
   398  	"typhoon", "tyvek", "uganda", "ukraine", "ukrainian",
   399  	"umbrella", "uncle", "underclothes", "underpants",
   400  	"undershirt", "underwear", "unit", "united kingdom",
   401  	"unshielded", "use", "utensil", "uzbekistan", "vacation",
   402  	"vacuum", "valley", "value", "van", "vase", "vault",
   403  	"vegetable", "vegetarian", "veil", "vein", "velvet",
   404  	"venezuela", "venezuelan", "verdict", "vermicelli", "verse",
   405  	"vessel", "vest", "veterinarian", "vibraphone", "vietnam",
   406  	"view", "vinyl", "viola", "violet", "violin", "virgo",
   407  	"viscose", "vise", "vision", "visitor", "voice", "volcano",
   408  	"volleyball", "voyage", "vulture", "waiter", "waitress",
   409  	"walk", "wall", "wallaby", "wallet", "walrus", "war", "warm",
   410  	"wash", "washer", "wasp", "waste", "watch", "watchmaker",
   411  	"water", "waterfall", "wave", "wax", "way", "wealth",
   412  	"weapon", "weasel", "weather", "wedge", "wednesday", "weed",
   413  	"weeder", "week", "weight", "whale", "wheel", "whip",
   414  	"whiskey", "whistle", "white", "wholesaler", "whorl",
   415  	"wilderness", "william", "willow", "wind", "windchime",
   416  	"window", "windscreen", "windshield", "wine", "wing",
   417  	"winter", "wire", "wish", "witch", "withdrawal", "witness",
   418  	"wolf", "woman", "women", "wood", "wool", "woolen", "word",
   419  	"work", "workshop", "worm", "wound", "wrecker", "wren",
   420  	"wrench", "wrinkle", "wrist", "writer", "xylophone", "yacht",
   421  	"yak", "yam", "yard", "yarn", "year", "yellow", "yew",
   422  	"yogurt", "yoke", "yugoslavian", "zebra", "zephyr", "zinc",
   423  	"zipper", "zone", "zoo", "zoology",
   424  }
   425  
   426  func TestCardinality(t *testing.T) {
   427  	expected, expectedStdErr := 0.001, 0.07
   428  	hll, _ := NewGuess(expected)
   429  	for _, w := range words {
   430  		hll.Add([]byte(w))
   431  	}
   432  	w, c := uint64(len(words)), hll.Count()
   433  	stdErr := calculateStdErr(w, c)
   434  	t.Logf("Word list is %v words, estimate is %v, stdErr %v", w, c, stdErr)
   435  	if stdErr > expectedStdErr {
   436  		t.Fatalf("Expected %v, got %v", expectedStdErr, stdErr)
   437  	}
   438  }
   439  
   440  func calculateStdErr(actual, estimate uint64) float64 {
   441  	return math.Abs((float64(estimate) - float64(actual)) / float64(actual))
   442  }