Home | Trees | Indices | Help |
|
---|
|
1 # Natural Language Toolkit - AutoClass 2 # automatic class value generator 3 # 4 # Author: Sumukh Ghodke <sumukh dot ghodke at gmail dot com> 5 # 6 # URL: <http://nltk.sf.net> 7 # This software is distributed under GPL, for license information see LICENSE.TXT 812 1739 40 FIRST = AutoClass('a') 41 4919 base26 = 0 20 length = len(self.name) 21 for index in range(length): 22 numeric = ord(self.name[index]) - 97 23 if (index == length - 1): base26 += numeric 24 else: base26 += numeric * 26 * (length - index - 1) 25 return base262628 if other is None: return False 29 if self.__class__ != other.__class__: return False 30 if self.name == other.name: return True 31 return False32 3638 return self.name
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Wed May 16 22:47:58 2007 | http://epydoc.sourceforge.net |