Learn R Programming

bdpar (version 1.0.1)

pipeline_execute: Initiates the pipelining process.

Description

pipeline_execute is responsible for easily initialize the pipelining preprocessing proccess.

Usage

pipeline_execute(configurationFilePath = NULL, editConfigurationFile = FALSE, filesPath,
pipe = SerialPipe$new(), instanceFactory = InstanceFactory$new())

Arguments

configurationFilePath

(character) path where the configuration file is located. The file must have the .ini extension. In the case that the argument is null, the default configuration file (configurationsTemplate.ini) will be used.

editConfigurationFile

(boolean) indicates whether a file is opened to modify the configuration file or not.

filesPath

(character) path where the files to be preprocessed are located.

pipe

(TypePipe) subclass of TypePipe, which implements the whole pipeling process.

instanceFactory

(InstanceFactory) object implementing the method createInstance to choose which type of Instance is created.

Value

List of Instance that have been preprocessed.

Notes

In the case of choosing to edit the configuration file, the default editor will be opened.

Details

The configuration file can be indicated by the user or use the default configuration file (configurationsTemplate.ini). In addition, once we call the function, it will be possible to choose if the user wants to edit the file of indicated configurations or not.

The configurationFilePath file should have the following structure (Depends on the Pipes used). Also the configurationsTemplate.ini has this structure:

[twitter]

ConsumerKey = <<consumer_key>>

ConsumerSecret = <<consumer_secret>>

AccessToken = <<access_token>>

AccessTokenSecret = <<access_token_secret>>

[youtube]

app_id = <<app_id>>

app_password = <<app_password>>

[eml]

PartSelectedOnMPAlternative = <<part_selected>> (text/html or text/plain)

[resourcesPath]

resourcesAbbreviationsPath = <<resources_abbreviations_path>>

resourcesContractionsPath = <<resources_contractions_path>>

resourcesInterjectionsPath = <<resources_interjections_path>>

resourcesSlangsPath = <<resources_slangs_path>>

resourcesStopWordsPath = <<resources_stopWords_path>>

[CSVPath]

outPutTeeCSVPipePath = <<out_put_teeCSVPipe_path>>

[cache]

cachePathTwtid = <<cache_path_twtid>>

cachePathYtbid = <<cache_path_ytbid>>

Examples

Run this code
# NOT RUN {
#Path where the configuration file are located
configurationFilePath <- system.file(file.path("examples",
                                               "configurationsExample.ini"),
                                     package ="bdpar")

#Folder with the files to preprocess
filesPath <- system.file(file.path("examples",
                                   "testFiles"),
                         package = "bdpar")

#Object which indicates the pipes' flow
pipe <- SerialPipe$new()

#Object which decides how creates the instances
instanceFactory <- InstanceFactory$new()

#Starting file preprocessing...
pipeline_execute(configurationFilePath = configurationFilePath,
                 filesPath = filesPath,
                 pipe = pipe,
                 instanceFactory = instanceFactory)
# }

Run the code above in your browser using DataLab