Package nltk :: Package ccg :: Module api :: Class CCGVar
[hide private]
[frames] | no frames]

type CCGVar

source code

         object --+    
                  |    
AbstractCCGCategory --+
                      |
                     CCGVar

Class representing a variable CCG category. Used for conjunctions (and possibly type-raising, if implemented as a unary rule).

Instance Methods [hide private]
 
__init__(self, prim_only=False)
Initialize a variable (selects a new identifier)
source code
 
is_primitive(self) source code
 
is_function(self) source code
 
is_var(self) source code
 
substitute(self, substitutions)
If there is a substitution corresponding to this variable, return the substituted category.
source code
 
can_unify(self, other)
If the variable can be replaced with other a substitution is returned.
source code
 
id(self) source code
 
__cmp__(self, other) source code
 
__hash__(self) source code
 
__str__(self) source code
Class Methods [hide private]
 
new_id(cls) source code
Class Variables [hide private]
  _maxID = 1
Method Details [hide private]

__init__(self, prim_only=False)
(Constructor)

source code 

Initialize a variable (selects a new identifier)

Parameters:
  • prim_only (boolean) - a boolean that determines whether the variable is restricted to primitives
Overrides: object.__init__

is_primitive(self)

source code 
Overrides: AbstractCCGCategory.is_primitive

is_function(self)

source code 
Overrides: AbstractCCGCategory.is_function

is_var(self)

source code 
Overrides: AbstractCCGCategory.is_var

substitute(self, substitutions)

source code 

If there is a substitution corresponding to this variable, return the substituted category.

Overrides: AbstractCCGCategory.substitute

can_unify(self, other)

source code 

If the variable can be replaced with other a substitution is returned.

Overrides: AbstractCCGCategory.can_unify

__cmp__(self, other)
(Comparison operator)

source code 
Overrides: AbstractCCGCategory.__cmp__

__hash__(self)
(Hashing function)

source code 
Overrides: AbstractCCGCategory.__hash__

__str__(self)
(Informal representation operator)

source code 
Overrides: AbstractCCGCategory.__str__