Package pywurfl :: Module algorithms :: Class Tokenizer
[hide private]
[frames] | no frames]

Class Tokenizer

source code

object --+    
         |    
 Algorithm --+
             |
            Tokenizer

Tokenizer Search Algorithm

Instance Methods [hide private]
  __init__(self, devwindow=30)
  _tokenize(self, s)
Device __call__(self, ua, devices)

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Class Variables [hide private]
  tokenize_chars = ('/', '.', '-', '_', ' ')

Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, devwindow=30)
(Constructor)

source code 
Parameters:
  • devwindow (integer) - If more than devwindow user agents match, return empty device.
Overrides: object.__init__

_tokenize(self, s)

source code 
Parameters:
  • s (string) - The user agent to tokenize

__call__(self, ua, devices)
(Call operator)

source code 
Parameters:
  • ua (string) - The user agent
  • devices (Devices) - The devices object to search
Returns: Device
Overrides: Algorithm.__call__

Class Variable Details [hide private]

tokenize_chars

None
Value:
('/', '.', '-', '_', ' ')