Package miopia :: Package preprocessor :: Module HashTagProcessor :: Class HashTagProcessor
[hide private]
[frames] | no frames]

Class HashTagProcessor

source code

                             object --+        
                                      |        
            PreProcessorI.PreProcessorI --+    
                                          |    
PreProcessorDecorator.PreProcessorDecorator --+
                                              |
                                             HashTagProcessor

classdocs

Instance Methods [hide private]
 
__init__(self, component, remove_bordering=False)
Constructor
source code
 
preprocess(self, text) source code
 
is_bordering_hashtag(self, text, hashtag, nocurrence)
Returns: 0 if is not a bordering hashtag, -1 if it's an initial hashtag and 1 if it's an ending hashtag
source code
 
_process_hashtag(self, text) source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, component, remove_bordering=False)
(Constructor)

source code 

Constructor

Parameters:
Overrides: object.__init__

preprocess(self, text)

source code 
Parameters:
  • text - A tweet as a string @return A hashtag processed tweet
Overrides: PreProcessorI.PreProcessorI.preprocess

is_bordering_hashtag(self, text, hashtag, nocurrence)

source code 
Returns:
0 if is not a bordering hashtag, -1 if it's an initial hashtag and 1 if it's an ending hashtag

_process_hashtag(self, text)

source code 
Parameters:
  • text - A tweet. It is a String Eliminate the complete hashtag if there is at the beginning or the end of the text. Otherwise, only delete '#' symbol. Special hashtags as #FF always represented without #, never deleted.