Package nltk :: Package corpus :: Module chat80 :: Class Concept
[hide private]
[frames] | no frames]

Class Concept

source code

object --+
         |
        Concept

A Concept class, loosely based on SKOS (http://www.w3.org/TR/swbp-skos-core-guide/).

Instance Methods [hide private]
 
__init__(self, prefLabel, arity, altLabels=[], closures=[], extension=set([]))
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__str__(self)
str(x)
source code
 
__repr__(self)
repr(x)
source code
set
augment(self, data)
Add more data to the Concept's extension set.
source code
 
_make_graph(self, s)
Convert a set of pairs into an adjacency linked list encoding of a graph.
source code
 
_transclose(self, g)
Compute the transitive closure of a graph represented as a linked list.
source code
 
_make_pairs(self, g)
Convert an adjacency linked list back into a set of pairs.
source code
 
close(self)
Close a binary relation in the Concept's extension set.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, prefLabel, arity, altLabels=[], closures=[], extension=set([]))
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • prefLabel (str) - the preferred label for the concept
  • arity (int) - the arity of the concept
  • altLabels (list) - other (related) labels
  • closures (list) - closure properties of the extension (list items can be symmetric, reflexive, transitive)
  • extension (set) - the extensional value of the concept
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

augment(self, data)

source code 

Add more data to the Concept's extension set.

Parameters:
  • data (string or pair of strings) - a new semantic value
Returns: set

close(self)

source code 

Close a binary relation in the Concept's extension set.

Returns:
a new extension for the Concept in which the relation is closed under a given property