Package nltk_lite :: Package parse :: Class ParseI
[show private | hide private]
[frames | no frames]

Type ParseI

object --+
         |
        ParseI

Known Subclasses:
AbstractParse, ChunkParseI

A processing class for deriving trees that represent possible structures for a sequence of tokens. These tree structures are known as parses. Typically, parsers are used to derive syntax trees for sentences. But parsers can also be used to derive other kinds of tree structure, such as morphological trees and discourse structures.
Method Summary
Tree get_parse(self, sent)
Return a parse tree that represents the structure of the sentence.
dict get_parse_list(self, sent)
Return a dictionary mapping from the parse trees for the sentence to numeric scores.
ProbDistI get_parse_probs(self, sent)
Return a probability distribution over the parse trees for the sentence.
  parse(self, sent)
Derive a parse tree that represents the structure of the given sentences words, and return a Tree.
Inherited from object: __init__, __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Method Details

get_parse(self, sent)

Parameters:
sent - The sentence to be parsed
           (type=list of string)
Returns:
A parse tree that represents the structure of the sentence. If no parse is found, then return None.
           (type=Tree)

get_parse_list(self, sent)

Parameters:
sent - The sentence to be parsed
           (type=list of string)
Returns:
A dictionary mapping from the parse trees for the sentence to numeric scores.
           (type=dict)

get_parse_probs(self, sent)

Parameters:
sent - The sentence to be parsed
           (type=list of string)
Returns:
A probability distribution over the parse trees for the sentence.
           (type=ProbDistI)

parse(self, sent)

Derive a parse tree that represents the structure of the given sentences words, and return a Tree. If no parse is found, then output None. If multiple parses are found, then output the best parse.

The parsed trees derive a structure for the subtokens, but do not modify them. In particular, the leaves of the subtree should be equal to the list of subtokens.
Parameters:
sent - The sentence to be parsed
           (type=list of string)

Generated by Epydoc 2.1 on Tue Sep 5 09:37:21 2006 http://epydoc.sf.net