Class CrfLauncher

java.lang.Object
org.coordinatekit.crf.cli.CrfLauncher

@NullMarked public final class CrfLauncher extends Object
The entry point for the crf command-line tool.

main(String[]) runs the tool and exits the process with the resulting code; run(String[]) does the same work but returns the code instead of exiting, so it can be embedded or tested. Both route annotate and retokenize as picocli subcommands and resolve the domain services (tag provider, tokenizer, feature extractor, model loader) through ServiceLoader.

The tool ships no services of its own: a downstream puts its implementations on the classpath as META-INF/services providers — at minimum a TagProvider, plus the mallet module when --model is used. With none registered, a run fails fast with guidance rather than producing garbage. Per-slot precedence is explicit > single service implementation > built-in default; see ResolvedServices.

Exit codes follow the subcommands: 0 on success or --help, 1 on a startup or run failure, 2 on a rejected argument list (including an unknown or missing subcommand).

  • Method Details

    • main

      public static void main(String[] arguments)
      Runs the tool and terminates the JVM with the resulting exit code.
      Parameters:
      arguments - the raw command-line arguments
    • run

      public static int run(String[] arguments)
      Runs the tool against arguments and returns the process exit code without terminating the JVM.
      Parameters:
      arguments - the raw command-line arguments
      Returns:
      the process exit code