Class RetokenizeRunner
This is the peer of AnnotatorRunner for the retokenize flow: where
AnnotatorRunner drives Annotator.annotate(Path, Path), this class drives
RetokenizeReviewer.review(Path, Path). It is the home of the retokenize invocation logic,
separated from the picocli command RetokenizeCommand (in the cli module). A
caller that parses with its own command-line framework builds a RetokenizeConfiguration
and calls run(RetokenizeConfiguration, ReviewerFactory); this class performs the
interactive-terminal precondition, the fresh-pass precondition, and the exit-code mapping, but
does no argument parsing and imports no command-line parser. The shared terminal glue lives in
TerminalSupport.
The reviewerFactory wires the typed beans (tag provider, tokenizer, feature extractor,
optional CRF tagger) into a RetokenizeReviewer, wiring the same tokenizer into
both the reviewer and any CrfTagger, as
RetokenizeReviewer's contract requires.
Exit codes:
0— review completed;1— interactive-terminal precondition failed, the terminal could not be opened, the review's fresh-pass precondition was violated (input path equals output, or the output exists and is non-empty), orRetokenizeReviewer.review(Path, Path)threw anIOException.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFactory that wires the typed beans (tag provider, tokenizer, feature extractor, optional CRF tagger) into aRetokenizeReviewer. -
Method Summary
Modifier and TypeMethodDescriptionstatic intrun(RetokenizeConfiguration configuration, RetokenizeRunner.ReviewerFactory factory) Opens an interactive system terminal and runs the reviewer produced byfactory.
-
Method Details
-
run
public static int run(RetokenizeConfiguration configuration, RetokenizeRunner.ReviewerFactory factory) Opens an interactive system terminal and runs the reviewer produced byfactory. Returns a process exit code suitable forSystem.exit(int).- Parameters:
configuration- the parser-free retokenize configurationfactory- the factory that constructs the reviewer from the configuration and terminal- Returns:
- the process exit code
-