Package sentence :: Module sentence :: Class SimpleSentence
[hide private]
[frames] | no frames]

Class SimpleSentence

source code

object --+
         |
        SimpleSentence

A simple (shallow) sentence object, which wraps both a sentence and its attributes

Instance Methods [hide private]
 
__init__(self, string='', attributes={})
Initializes a simple (shallow) sentence object, which wraps both a sentence and its attributes
source code
 
__eq__(self, other) source code
String
get_string(self)
Get the string of this simple sentence
source code
dict
get_attributes(self)
Get the attributes of this sentence
source code
 
get_rank(self) source code
 
add_attribute(self, key, value) source code
 
get_attribute(self, key, sub=None) source code
 
add_attributes(self, attributes) source code
 
rename_attribute(self, old_name, new_name) source code
 
del_attribute(self, attribute) source code
 
keep_only_attributes(self, attribute_names) source code
 
__str__(self)
str(x)
source code
 
merge_simplesentence(self, ss, attribute_replacements={})
Add the attributes to the object SimpleSentence().
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, string='', attributes={})
(Constructor)

source code 

Initializes a simple (shallow) sentence object, which wraps both a sentence and its attributes

Parameters:
  • string (string) - the string that the simple sentence will consist of
  • attributes ({String key, String value}) - a dictionary of arguments that describe properties of the simple sentence
Overrides: object.__init__

get_string(self)

source code 

Get the string of this simple sentence

Returns: String
the text contained in the simple sentence

get_attributes(self)

source code 

Get the attributes of this sentence

Returns: dict
a dictionary of attributes that describe properties of the sentence

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

merge_simplesentence(self, ss, attribute_replacements={})

source code 

Add the attributes to the object SimpleSentence(). In place

Parameters:
  • attr (dict) - attributes of a simple sentence