Class: Preprocessor::IDMapping
- Defined in:
- lib/svm_helper/preprocessors/id_mapping.rb
Overview
Preprocessor Base Class
Constant Summary
Constants inherited from Simple
Simple::CODE_TOKEN_FILTER, Simple::EMAIL_FILTER, Simple::GENDER_FILTER, Simple::NEW_LINES, Simple::STOPWORD_LOCATION, Simple::SYMBOL_FILTER, Simple::URL_FILTER, Simple::WHITESPACE, Simple::WORDS_IN_BRACKETS, Simple::XML_TAG_FILTER
Constants included from ParallelHelper
Instance Attribute Summary collapse
-
#id_map ⇒ Object
readonly
Returns the value of attribute id_map.
Attributes inherited from Simple
Instance Method Summary collapse
-
#initialize(id_map, args = {}) ⇒ IDMapping
constructor
A new instance of IDMapping.
- #label ⇒ Object
- #map_id(id) ⇒ Object
Methods inherited from Simple
#clean_description, #clean_title, #process, #strip_stopwords
Methods included from ParallelHelper
#p_map, #p_map_with_index, #parallel?
Constructor Details
#initialize(id_map, args = {}) ⇒ IDMapping
Returns a new instance of IDMapping.
14 15 16 17 |
# File 'lib/svm_helper/preprocessors/id_mapping.rb', line 14 def initialize id_map, args={} super(args) @id_map = id_map end |
Instance Attribute Details
#id_map ⇒ Object (readonly)
Returns the value of attribute id_map.
9 10 11 |
# File 'lib/svm_helper/preprocessors/id_mapping.rb', line 9 def id_map @id_map end |
Instance Method Details
#label ⇒ Object
22 23 24 |
# File 'lib/svm_helper/preprocessors/id_mapping.rb', line 22 def label "with_id_mapping" end |
#map_id(id) ⇒ Object
19 20 21 |
# File 'lib/svm_helper/preprocessors/id_mapping.rb', line 19 def map_id(id) @id_map[id] end |