Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Static Private Attributes
CMFPlone.UnicodeSplitter.Splitter Class Reference

List of all members.

Public Member Functions

def process
def processGlob

Static Public Attributes

tuple rx_L = re.compile(r"\w+", re.LOCALE)
tuple rxGlob_L = re.compile(r"\w+[\w*?]*", re.LOCALE)
tuple rx_U = re.compile(r"\w+", re.UNICODE)
tuple rxGlob_U = re.compile(r"\w+[\w*?]*", re.UNICODE)

Static Private Attributes

 __implements__ = ISplitter

Detailed Description

Definition at line 38 of file UnicodeSplitter.py.


Member Function Documentation

def CMFPlone.UnicodeSplitter.Splitter.process (   self,
  lst 
)

Definition at line 48 of file UnicodeSplitter.py.

00048 
00049     def process(self, lst):
00050         result = []
00051         for s in lst:
00052             # This is a hack to get the word splitting working with
00053             # non-unicode text.
00054             try:
00055                 if not isinstance(s, unicode):
00056                     s = unicode(s, enc)
00057             except (UnicodeDecodeError, TypeError):
00058                 # Fall back to locale aware splitter
00059                 result += self.rx_L.findall(s)
00060             else:
00061                 words = self.rx_U.findall(s)
00062                 result += [w.encode(enc) for w in words]
00063         return result

Definition at line 64 of file UnicodeSplitter.py.

00064 
00065     def processGlob(self, lst):
00066         result = []
00067         for s in lst:
00068             # This is a hack to get the word splitting working with
00069             # non-unicode text.
00070             try:
00071                 if not isinstance(s, unicode):
00072                     s = unicode(s, enc)
00073             except (UnicodeDecodeError, TypeError):
00074                 # Fall back to locale aware splitter
00075                 result += self.rxGlob_L.findall(s)
00076             else:
00077                 words = self.rxGlob_U.findall(s)
00078                 result += [w.encode(enc) for w in words]
00079         return result
00080 
00081 classImplements(Splitter, Splitter.__implements__)
00082 
try:

Here is the call graph for this function:


Member Data Documentation

CMFPlone.UnicodeSplitter.Splitter.__implements__ = ISplitter [static, private]

Definition at line 40 of file UnicodeSplitter.py.

tuple CMFPlone.UnicodeSplitter.Splitter.rx_L = re.compile(r"\w+", re.LOCALE) [static]

Definition at line 42 of file UnicodeSplitter.py.

tuple CMFPlone.UnicodeSplitter.Splitter.rx_U = re.compile(r"\w+", re.UNICODE) [static]

Definition at line 45 of file UnicodeSplitter.py.

tuple CMFPlone.UnicodeSplitter.Splitter.rxGlob_L = re.compile(r"\w+[\w*?]*", re.LOCALE) [static]

Definition at line 43 of file UnicodeSplitter.py.

tuple CMFPlone.UnicodeSplitter.Splitter.rxGlob_U = re.compile(r"\w+[\w*?]*", re.UNICODE) [static]

Definition at line 46 of file UnicodeSplitter.py.


The documentation for this class was generated from the following file: