Package opennlp.spellcheck.cmdline

# Class CorrectTextTool

java.lang.Object
opennlp.tools.cmdline.CmdLineTool
opennlp.tools.cmdline.BasicCmdLineTool
opennlp.spellcheck.cmdline.CorrectTextTool

public class CorrectTextTool extends opennlp.tools.cmdline.BasicCmdLineTool
A command line tool that corrects spelling in text using a `SymSpellModel`.

The model is either loaded from a file (`-model`) or resolved from the classpath by language (`-lang`) via `SymSpellModelResolver`. Input is read line by line from a file (`-inputFile`) or, when absent, from standard input; corrected output is written to a file (`-outputFile`) or to standard output.

By default each line is corrected token by token. With `-compound true` the whole line is corrected as a phrase, additionally repairing wrong word splits and merges. With `-suggest true` the tool instead lists the candidate suggestions for every token (honoring `-verbosity`) rather than emitting corrected text.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CorrectTextTool()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getHelp()`
  `String`
  `getShortDescription()`
  `void`
  `run(String[] args)`

  ### Methods inherited from class opennlp.tools.cmdline.CmdLineTool

  `getName, hasParams`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CorrectTextTool

    public CorrectTextTool()

- ## Method Details

  - ### getShortDescription

    public String getShortDescription()
    Overrides:
      `getShortDescription` in class `opennlp.tools.cmdline.CmdLineTool`

  - ### getHelp

    public String getHelp()
    Specified by:
      `getHelp` in class `opennlp.tools.cmdline.CmdLineTool`

  - ### run

    public void run(String[] args)
    Specified by:
      `run` in class `opennlp.tools.cmdline.BasicCmdLineTool`