Package nltk :: Module sourcedstring :: Class CompoundSourcedUnicodeString
[hide private]
[frames] | no frames]

type CompoundSourcedUnicodeString

source code

   object --+            
            |            
   basestring --+        
                |        
    SourcedString --+    
                    |    
CompoundSourcedString --+
                        |
       object --+       |
                |       |
       basestring --+   |
                    |   |
              unicode --+
                        |
                       CompoundSourcedUnicodeString

Nested Classes [hide private]
_stringtype
A class variable, defined by subclasses of SourcedString, determining what type of string this class contains.
Instance Methods [hide private]
 
__init__(self, substrings)
Construct a new compound sourced string that combines the given list of substrings.
source code

Inherited from CompoundSourcedString: __getitem__, __getslice__, __repr__, capitalize, lower, swapcase, title, upper

Inherited from CompoundSourcedString (private): _source_repr

Inherited from unicode: __contains__, __eq__, __ge__, __getattribute__, __getnewargs__, __gt__, __hash__, __le__, __len__, __lt__, __ne__, __rmod__, __str__, count, endswith, find, index, isalnum, isalpha, isdecimal, isdigit, islower, isnumeric, isspace, istitle, isupper, rfind, rindex, startswith

    Splitting & Stripping Methods

Inherited from SourcedString: lstrip, partition, rpartition, rsplit, rstrip, split, splitlines, strip

    String Concatenation Methods

Inherited from SourcedString: __add__, __mul__, __radd__, __rmul__, join

    Justification Methods

Inherited from SourcedString: center, ljust, rjust, zfill

    Replacement Methods

Inherited from SourcedString: __mod__, expandtabs, replace, translate

    Unicode

Inherited from CompoundSourcedString: encode

Inherited from CompoundSourcedString (private): _decode_one_to_one

Inherited from SourcedString: decode

    Display

Inherited from SourcedString: pprint

Static Methods [hide private]

Inherited from CompoundSourcedString: __new__

    String Concatenation Methods

Inherited from SourcedString: concat

Class Variables [hide private]
    Splitting & Stripping Methods

Inherited from SourcedString (private): _LINE_RE, _NEWLINE_RE, _WHITESPACE_RE

    Display

Inherited from SourcedString (private): _PPRINT_CHAR_REPRS

Instance Variables [hide private]

Inherited from CompoundSourcedString: substrings

Properties [hide private]

Inherited from CompoundSourcedString: sources

Method Details [hide private]

__init__(self, substrings)
(Constructor)

source code 

Construct a new compound sourced string that combines the given list of substrings.

Typically, compound sourced strings should not be constructed directly; instead, use SourcedString.concat(), which flattens nested compound sourced strings, and merges adjacent substrings when possible.

Raises:
  • ValueError - If len(substrings) < 2
  • ValueError - If substrings contains any CompoundSourcedStrings.
Overrides: CompoundSourcedString.__init__
(inherited documentation)