Pepper  3.6.0
A highly extensible plattform for conversion and manipulationoflinguisticdata.
org.corpus_tools.pepper.cli.ConvertWizardConsole Class Reference

This class represents a console to realize a kind of an interactive wizard to guide the user through the workflow configuration. More...

Classes

enum  COMMAND
 
class  ExitWizardException
 

Public Member Functions

 ConvertWizardConsole (String prefixPrompt)
 Initializes an object. More...
 
Pepper getPepper ()
 
void setPepper (Pepper pepper)
 
void start ()
 Starts this console, using std in and std out.
 
synchronized PepperJob start (BufferedReader in, PrintStream out)
 Starts the wizard for a 'session'. More...
 
boolean importPhase (PepperJob pepperJob)
 A sub wizard to manage the import phase. More...
 
void manipulationPhase (PepperJob pepperJob)
 A sub wizard to manage the manipulation phase. More...
 
boolean exportPhase (PepperJob pepperJob)
 A sub wizard to manage the import phase. More...
 

Static Public Member Functions

static void deresolveURIs (File outputFile, PepperJob pepperJob) throws IOException
 Before saving, create relative URIs for Pepper job. More...
 

Public Attributes

Boolean isDebug = false
 Determines if debug mode is on or off.
 

Detailed Description

This class represents a console to realize a kind of an interactive wizard to guide the user through the workflow configuration.

This is a step by step wizard in which the the user needs to make an input for each step:

  1. Import phase
    1. choose source corpus
    2. choose importer (if possible show a list of recommended importers and the rest)
    3. choose configuration properties (wizard presents a list of possible properties)
    4. another importer? press enter for no, corpus path for yes
  2. Manipulation phase
    1. choose manipulator (enter for non)
    2. choose configuration properties (wizard presents a list of possible properties)
    3. another manipulator? press enter for no
  3. Export phase

    1. choose target path for corpus
    2. choose configuration properties (wizard presents a list of possible properties)
    3. another exporter? press enter for no, corpus path for yes

Author
Florian Zipser

Constructor & Destructor Documentation

◆ ConvertWizardConsole()

org.corpus_tools.pepper.cli.ConvertWizardConsole.ConvertWizardConsole ( String  prefixPrompt)

Initializes an object.

Parameters
prefixPromptthe prefix prompt to be displayed, before the prompt of this console.

Member Function Documentation

◆ deresolveURIs()

static void org.corpus_tools.pepper.cli.ConvertWizardConsole.deresolveURIs ( File  outputFile,
PepperJob  pepperJob 
) throws IOException
static

Before saving, create relative URIs for Pepper job.

Create a base URI to deresolve relative URIs

Parameters
outputFile
pepperJob
Exceptions
IOException

◆ exportPhase()

boolean org.corpus_tools.pepper.cli.ConvertWizardConsole.exportPhase ( PepperJob  pepperJob)

A sub wizard to manage the import phase.

Asks all importers from the user.

  1. state 0: choose output path, empty input leads to exit of export phase
  2. state 1: choose exporter
  3. state 2: choose property, empty input leads to state 0
Parameters
pepperJobthe PepperJob object to be filled.
Returns
if an exporter was set, false otherwise

◆ getPepper()

Pepper org.corpus_tools.pepper.cli.ConvertWizardConsole.getPepper ( )
Returns
The Pepper object, which shall create and run the job

◆ importPhase()

boolean org.corpus_tools.pepper.cli.ConvertWizardConsole.importPhase ( PepperJob  pepperJob)

A sub wizard to manage the import phase.

Asks all importers from the user.

  1. state 0: reads corpus path, empty input leads to exit import phase
  2. state 1: choose importer
  3. state 2: choose properties, empty input leads to state 0
Parameters
pepperJobthe PepperJob object to be filled.
Returns
true if an importer was chosen, false if phase was aborted

◆ manipulationPhase()

void org.corpus_tools.pepper.cli.ConvertWizardConsole.manipulationPhase ( PepperJob  pepperJob)

A sub wizard to manage the manipulation phase.

Asks for all manipulators from the user.

  1. state 1: reads name of manipulator, empty input leads to exit import phase
  2. state 2: asks for properties, input leads to state 1
Parameters
pepperJobthe PepperJob object to be filled.
Returns

◆ setPepper()

void org.corpus_tools.pepper.cli.ConvertWizardConsole.setPepper ( Pepper  pepper)
Parameters
pepperThe Pepper object, which shall create and run the job

◆ start()

synchronized PepperJob org.corpus_tools.pepper.cli.ConvertWizardConsole.start ( BufferedReader  in,
PrintStream  out 
)

Starts the wizard for a 'session'.

A wizard can only be started as singleton. That means it needs to be quit before it can be started again.

  1. startes wizard for import phase importPhase(PepperJob)
  2. startes wizard for manipulation phase manipulationPhase(PepperJob)
  3. startes wizard for export phase exportPhase(PepperJob)
  4. requests user input {@value COMMAND::SAVE} to store workflow description or {@value COMMAND::CONVERT} to start conversion
Parameters
in
out