Package nltk_lite :: Package wordnet :: Module lexname
[hide private]
[frames] | no frames]

Source Code for Module nltk_lite.wordnet.lexname

 1  # Natural Language Toolkit: Wordnet Interface 
 2  # 
 3  # Copyright (C) 2001-2007 University of Pennsylvania 
 4  # Author: Oliver Steele <steele@osteele.com> 
 5  #         David Ormiston Smith <daosmith@csse.unimelb.edu.au>> 
 6  #         Steven Bird <sb@csse.unimelb.edu.au> 
 7  # URL: <http://nltk.sf.net> 
 8  # For license information, see LICENSE.TXT 
 9   
10  from pos import * 
11  from nltk_lite.wordnet import * 
12   
13  # Lexname class 
14   
15 -class Lexname(object):
16 dict = {} 17 lexnames = [] 18
19 - def __init__(self, name, category):
20 self.name = name 21 self.category = category 22 Lexname.dict[name] = self 23 Lexname.lexnames.append(self)
24
25 - def __str__(self):
26 return self.name
27 28 # Create Lexname objects, originally sourced from the lexnames file available 29 # as a patch from the Pywordnet sourceforge site. This list may be updated by 30 # the creators of Wordnet at any time. 31 32 Lexname("adj.all", ADJECTIVE) 33 Lexname("adj.pert", ADJECTIVE) 34 Lexname("adj.ppl", ADJECTIVE) 35 Lexname("adv.all", ADVERB) 36 Lexname("noun.Tops", NOUN) 37 Lexname("noun.act", NOUN) 38 Lexname("noun.animal", NOUN) 39 Lexname("noun.artifcact", NOUN) 40 Lexname("noun.attribute", NOUN) 41 Lexname("noun.body", NOUN) 42 Lexname("noun.cognition", NOUN) 43 Lexname("noun.communication", NOUN) 44 Lexname("noun.event", NOUN) 45 Lexname("noun.feeling", NOUN) 46 Lexname("noun.food", NOUN) 47 Lexname("noun.group", NOUN) 48 Lexname("noun.location", NOUN) 49 Lexname("noun.motive", NOUN) 50 Lexname("noun.object", NOUN) 51 Lexname("noun.person", NOUN) 52 Lexname("noun.phenomenon", NOUN) 53 Lexname("noun.plant", NOUN) 54 Lexname("noun.possession", NOUN) 55 Lexname("noun.process", NOUN) 56 Lexname("noun.quantity", NOUN) 57 Lexname("noun.relation", NOUN) 58 Lexname("noun.shape", NOUN) 59 Lexname("noun.state", NOUN) 60 Lexname("noun.substance", NOUN) 61 Lexname("noun.time", NOUN) 62 Lexname("verb.body", VERB) 63 Lexname("verb.change", VERB) 64 Lexname("verb.cognition", VERB) 65 Lexname("verb.communication", VERB) 66 Lexname("verb.competition", VERB) 67 Lexname("verb.consumption", VERB) 68 Lexname("verb.contact", VERB) 69 Lexname("verb.creation", VERB) 70 Lexname("verb.emotion", VERB) 71 Lexname("verb.motion", VERB) 72 Lexname("verb.perception", VERB) 73 Lexname("verb.possession", VERB) 74 Lexname("verb.social", VERB) 75 Lexname("verb.stative", VERB) 76 Lexname("verb.weather", VERB) 77