TokenNameFinderTrainerTool (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.cmdline.namefind

## Class TokenNameFinderTrainerTool

- java.lang.Object
- - opennlp.tools.cmdline.CmdLineTool
  - - opennlp.tools.cmdline.TypedCmdLineTool<T>
    - - opennlp.tools.cmdline.AbstractTypedParamTool<T,P>
      - - opennlp.tools.cmdline.AbstractEvaluatorTool<T,P>
        - - opennlp.tools.cmdline.AbstractTrainerTool<NameSample,opennlp.tools.cmdline.namefind.TokenNameFinderTrainerTool.TrainerToolParams>
          - - opennlp.tools.cmdline.namefind.TokenNameFinderTrainerTool

-     public final class TokenNameFinderTrainerTool
      extends opennlp.tools.cmdline.AbstractTrainerTool<NameSample,opennlp.tools.cmdline.namefind.TokenNameFinderTrainerTool.TrainerToolParams>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TokenNameFinderTrainerTool()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getShortDescription()` Retrieves a short description of what the tool does.
    `static Map<String,Object>` | `loadResources(File resourcePath, File featureGenDescriptor)` Load the resources, such as dictionaries, by reading the feature xml descriptor and looking into the directory passed as argument.
    `static byte[]` | `openFeatureGeneratorBytes(File featureGenDescriptorFile)`
    `void` | `run(String format, String[] args)` Executes the tool with the given parameters.

    - ### Methods inherited from class opennlp.tools.cmdline.AbstractTypedParamTool

      `getHelp`

    - ### Methods inherited from class opennlp.tools.cmdline.TypedCmdLineTool

      `getHelp`

    - ### 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 Detail

    - #### TokenNameFinderTrainerTool

          public TokenNameFinderTrainerTool()

  - ### Method Detail

    - #### getShortDescription

          public String getShortDescription()

      Description copied from class: `opennlp.tools.cmdline.CmdLineTool`
      Retrieves a short description of what the tool does.
      Overrides:
        `getShortDescription` in class `opennlp.tools.cmdline.CmdLineTool`
      Returns:
        a short description of what the tool does

    - #### openFeatureGeneratorBytes

          public static byte[] openFeatureGeneratorBytes(File featureGenDescriptorFile)

    - #### loadResources

          public static Map<String,Object> loadResources(File resourcePath,
                                                         File featureGenDescriptor)
                                                  throws IOException

      Load the resources, such as dictionaries, by reading the feature xml descriptor and looking into the directory passed as argument.
      Parameters:
        `resourcePath` - the directory in which the resources are to be found
        `featureGenDescriptor` - the feature xml descriptor
      Returns:
        a map consisting of the file name of the resource and its corresponding Object
      Throws:
        `IOException`

    - #### run

          public void run(String format,
                          String[] args)

      Description copied from class: `opennlp.tools.cmdline.TypedCmdLineTool`
      Executes the tool with the given parameters.
      Overrides:
        `run` in class `opennlp.tools.cmdline.AbstractEvaluatorTool<NameSample,opennlp.tools.cmdline.namefind.TokenNameFinderTrainerTool.TrainerToolParams>`
      Parameters:
        `format` - format to work with
        `args` - command line arguments

Copyright © 2026 The Apache Software Foundation. All rights reserved.