Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.048 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'args': 0.05; 'am,': 0.12; 'stored': 0.13; 'wednesday,': 0.15; 'ideas?': 0.16; 'sentences.': 0.16; 'subject:independent': 0.16; 'unordered': 0.16; 'wrote:': 0.18; 'functions,': 0.18; 'dec': 0.22; 'assume': 0.22; 'header:In- Reply-To:1': 0.22; 'command': 0.24; 'message-id:@mail.gmail.com': 0.28; 'hash': 0.30; 'key,': 0.30; 'received:mail- bw0-f46.google.com': 0.30; 'subject:?': 0.31; 'words,': 0.32; 'list': 0.32; 'received:209.85.214': 0.32; 'object': 0.33; 'fri,': 0.34; 'to:addr:python-list': 0.34; 'ordered': 0.34; 'uses': 0.36; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'useful': 0.38; 'received:209': 0.40; 'to:addr:python.org': 0.40; '2011': 0.61; 'your': 0.61; 'order': 0.62; 'further': 0.64; 'tables,': 0.67; 'collection': 0.69; '30,': 0.74; '11:18': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=fhm814lP+Z7Y0rvzcgRw3ar4oL3vom5CtZ/VuYuJB3k=; b=waXEtNBo8e99N3GyVpKyte/QOFeB5z4SBgGzjNv95n9w0WO98+cybDPrgp+YIyAlC1 tYs3u7se6hYLLKwXg1BcnmfzoAXV7xwZBr1Q6yfEJ04utZbKAmv4/+UscE3wNPBeq/no wy750Ym/+XRJqD6KVhYqpHOkxDD9Z6f4VwoM8= MIME-Version: 1.0 In-Reply-To: <14681078.446.1322849892244.JavaMail.geo-discussion-forums@prmw23> References: <14681078.446.1322849892244.JavaMail.geo-discussion-forums@prmw23> From: Ian Kelly Date: Fri, 2 Dec 2011 11:37:26 -0700 Subject: Re: order independent hash? To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1322851079 news.xs4all.nl 6876 [2001:888:2000:d::a6]:44649 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:16565 On Fri, Dec 2, 2011 at 11:18 AM, 88888 Dihedral wrote: > On Wednesday, November 30, 2011 8:32:39 PM UTC+8, Neal Becker wrote: >> I like to hash a list of words (actually, the command line args of my pr= ogram) >> in such a way that different words will create different hash, but not s= ensitive >> to the order of the words. =A0Any ideas? > > For each word of your list as the key, an object of a hash can be used fu= rther > is stored as the value in the hash of the list of words. > > Assume that word 1 is the key and the hash stored is a sentence that uses > the key word 1. > > This is very useful to learn vocabularies and writing sentences. The OP is talking about hash functions, not hash tables, and furthermore he is talking about hashing the entire unordered collection of words, not hashing individual words or ordered sentences.