You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by rz...@apache.org on 2023/01/17 14:18:08 UTC

[opennlp] branch main updated: OPENNLP-1443 Enhance JavaDoc in opennlp.opennlp.cmdline packages

This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opennlp.git


The following commit(s) were added to refs/heads/main by this push:
     new 404184f8 OPENNLP-1443 Enhance JavaDoc in opennlp.opennlp.cmdline packages
404184f8 is described below

commit 404184f89d915f21fb587481ea6248c3aad4686e
Author: Martin Wiesner <ma...@hs-heilbronn.de>
AuthorDate: Fri Jan 13 15:53:00 2023 +0100

    OPENNLP-1443 Enhance JavaDoc in opennlp.opennlp.cmdline packages
    
    - adds missing JavaDoc
    - improves existing documentation for clarity
    - removes superfluous text
    - adds 'final' modifier where useful and applicable
    - adds 'Override' annotation where useful and applicable
    - fixes several typos
---
 .../tools/cmdline/AbstractTypedParamTool.java      |  1 +
 .../java/opennlp/tools/cmdline/ArgumentParser.java | 25 +++++------
 .../opennlp/tools/cmdline/BasicCmdLineTool.java    |  2 +-
 .../java/opennlp/tools/cmdline/CmdLineUtil.java    | 14 +++---
 .../tools/cmdline/DetailedFMeasureListener.java    |  7 ++-
 .../tools/cmdline/EvaluationErrorPrinter.java      | 16 +++----
 .../tools/cmdline/FineGrainedReportListener.java   | 51 ++++++++++------------
 .../opennlp/tools/cmdline/GenerateManualTool.java  | 25 +++++------
 .../opennlp/tools/cmdline/ObjectStreamFactory.java | 10 ++---
 .../tools/cmdline/SystemInputStreamFactory.java    |  3 +-
 .../tools/cmdline/TerminateToolException.java      |  6 +--
 .../opennlp/tools/cmdline/TypedCmdLineTool.java    | 21 ++++-----
 .../chunker/ChunkEvaluationErrorListener.java      |  2 +-
 .../cmdline/chunker/ChunkerConverterTool.java      |  3 ++
 .../cmdline/chunker/ChunkerEvaluatorTool.java      |  7 +++
 .../tools/cmdline/chunker/TrainingParams.java      |  2 +-
 .../tools/cmdline/doccat/DoccatConverterTool.java  |  7 +++
 .../tools/cmdline/doccat/DoccatEvaluatorTool.java  |  7 +++
 .../langdetect/LanguageDetectorConverterTool.java  |  7 +++
 .../langdetect/LanguageDetectorEvaluatorTool.java  |  7 +++
 .../lemmatizer/LemmatizerEvaluatorTool.java        |  7 +++
 .../LemmatizerFineGrainedReportListener.java       |  2 +-
 .../namefind/TokenNameFinderConverterTool.java     |  7 ++-
 .../namefind/TokenNameFinderEvaluatorTool.java     |  7 +++
 .../params/DetailedFMeasureEvaluatorParams.java    |  2 +-
 .../tools/cmdline/parser/ModelUpdaterTool.java     | 11 +----
 .../tools/cmdline/parser/ParserConverterTool.java  |  7 +++
 .../tools/cmdline/parser/ParserEvaluatorTool.java  |  7 +++
 .../opennlp/tools/cmdline/parser/ParserTool.java   |  2 +-
 .../tools/cmdline/parser/TrainingParams.java       |  2 +-
 .../cmdline/postag/POSTaggerConverterTool.java     |  7 +++
 .../cmdline/postag/POSTaggerEvaluatorTool.java     |  7 +++
 .../postag/POSTaggerFineGrainedReportListener.java |  2 +-
 .../sentdetect/SentenceDetectorConverterTool.java  |  7 +++
 .../sentdetect/SentenceDetectorEvaluatorTool.java  |  7 +++
 .../cmdline/sentdetect/SentenceDetectorTool.java   |  2 +-
 .../cmdline/tokenizer/TokenizerConverterTool.java  |  7 +++
 .../tokenizer/TokenizerMEEvaluatorTool.java        |  7 +++
 38 files changed, 202 insertions(+), 121 deletions(-)

diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/AbstractTypedParamTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/AbstractTypedParamTool.java
index e2fe648d..2a03797f 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/AbstractTypedParamTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/AbstractTypedParamTool.java
@@ -38,6 +38,7 @@ public abstract class AbstractTypedParamTool<T, P> extends TypedCmdLineTool<T, P
     this.paramsClass = paramsClass;
   }
 
+  @Override
   public String getHelp(String format) {
     if ("".equals(format) || StreamFactoryRegistry.DEFAULT_FORMAT.equals(format)) {
       return getBasicHelp(paramsClass,
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/ArgumentParser.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/ArgumentParser.java
index e2977502..b6bc1312 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/ArgumentParser.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/ArgumentParser.java
@@ -224,7 +224,7 @@ public class ArgumentParser {
   /**
    * Creates a usage string which can be printed in case the user did specify the arguments
    * incorrectly. Incorrectly is defined as {@link ArgumentParser#validateArguments(String[], Class)}
-   * returns false.
+   * returns {@code false}.
    *
    * @param argProxyInterface interface with parameter descriptions
    * @return the help message usage string
@@ -235,7 +235,7 @@ public class ArgumentParser {
 
   /**
    * Auxiliary class that holds information about an argument. This is used by the
-   * GenerateManualTool, which creates a Docbook for the CLI automatically.
+   * {@link GenerateManualTool}, which creates a Docbook for the CLI automatically.
    */
   static class Argument {
     private final String argument;
@@ -272,7 +272,7 @@ public class ArgumentParser {
 
 
   /**
-   * Outputs the arguments as a data structure so it can be used to create documentation.
+   * Outputs the arguments as a data structure, so it can be used to create documentation.
    *
    * @param argProxyInterfaces interfaces with parameter descriptions
    * @return the help message usage string
@@ -320,8 +320,7 @@ public class ArgumentParser {
   /**
    * Creates a usage string which can be printed in case the user did specify the arguments
    * incorrectly. Incorrectly is defined as {@link ArgumentParser#validateArguments(String[],
-   * Class[])}
-   * returns false.
+   * Class[])} returns {@code false}.
    *
    * @param argProxyInterfaces interfaces with parameter descriptions
    * @return the help message usage string
@@ -387,7 +386,7 @@ public class ArgumentParser {
    *
    * @param args command line arguments
    * @param argProxyInterface interface with parameters description
-   * @return true, if arguments are valid
+   * @return {@code true} if arguments are valid, {@code false otherwise}
    */
   public static <T> boolean validateArguments(String[] args, Class<T> argProxyInterface) {
     return validateArguments(args, new Class<?>[]{argProxyInterface});
@@ -400,7 +399,7 @@ public class ArgumentParser {
    *
    * @param args command line arguments
    * @param argProxyInterfaces interfaces with parameters description
-   * @return true, if arguments are valid
+   * @return {@code true} if arguments are valid, {@code false otherwise}
    */
   public static boolean validateArguments(String[] args, Class<?>... argProxyInterfaces) {
     return null == validateArgumentsLoudly(args, argProxyInterfaces);
@@ -411,7 +410,7 @@ public class ArgumentParser {
    *
    * @param args command line arguments
    * @param argProxyInterface interface with parameters description
-   * @return null, if arguments are valid or error message otherwise
+   * @return {@code null}, if arguments are valid or error message otherwise
    */
   public static String validateArgumentsLoudly(String[] args, Class<?> argProxyInterface) {
     return validateArgumentsLoudly(args, new Class<?>[]{argProxyInterface});
@@ -422,7 +421,7 @@ public class ArgumentParser {
    *
    * @param args command line arguments
    * @param argProxyInterfaces interfaces with parameters description
-   * @return null, if arguments are valid or error message otherwise
+   * @return {@code null}, if arguments are valid or error message otherwise
    */
   public static String validateArgumentsLoudly(String[] args, Class<?>... argProxyInterfaces) {
     // number of parameters must be always be even
@@ -478,7 +477,7 @@ public class ArgumentParser {
    * @return parsed parameters
    *
    * @throws TerminateToolException if an argument value cannot be parsed.
-   * @throws IllegalArgumentException if validateArguments returns false,
+   * @throws IllegalArgumentException if validateArguments returns {@code false},
    *     if the proxy interface is not compatible.
    */
   @SuppressWarnings("unchecked")
@@ -501,8 +500,6 @@ public class ArgumentParser {
 
         if (optionalParam.defaultValue().length() > 0)
           valueString = optionalParam.defaultValue();
-        else
-          valueString = null;
       }
 
       Class<?> returnType = method.getReturnType();
@@ -530,12 +527,12 @@ public class ArgumentParser {
   }
 
   /**
-   * Filters arguments leaving only those pertaining to argProxyInterface.
+   * Filters arguments leaving only those pertaining to {@code argProxyInterface}.
    *
    * @param args arguments
    * @param argProxyInterface interface with parameters description
    * @param <T> T
-   * @return arguments pertaining to argProxyInterface
+   * @return arguments pertaining to {@code argProxyInterface}
    */
   public static <T> String[] filter(String[] args, Class<T> argProxyInterface) {
     ArrayList<String> parameters = new ArrayList<>(args.length);
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/BasicCmdLineTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/BasicCmdLineTool.java
index 518f5481..50c7b3ff 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/BasicCmdLineTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/BasicCmdLineTool.java
@@ -20,7 +20,7 @@ package opennlp.tools.cmdline;
 import opennlp.tools.commons.Internal;
 
 /**
- * A simple tool which can be executed from the command line.
+ * A simple {@link CmdLineTool tool} which can be executed from the command line.
  * <p>
  * <b>Note:</b> Do not use this class, internal use only!
  */
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/CmdLineUtil.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/CmdLineUtil.java
index e645f2ff..6e75312d 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/CmdLineUtil.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/CmdLineUtil.java
@@ -57,13 +57,13 @@ public final class CmdLineUtil {
    * <p>
    * To pass the test it must:<br>
    * - exist<br>
-   * - not be a directory<br>
-   * - accessibly<br>
+   * - not be a directory,<br>
+   * - and be accessibly.<br>
    *
    * @param name the name which is used to refer to the file in an error message, it
    *     should start with a capital letter.
    *
-   * @param inFile the particular file to check to qualify an input file
+   * @param inFile the particular {@link File} to check to qualify an input file
    *
    * @throws TerminateToolException  if test does not pass this exception is
    *     thrown and an error message is printed to the console.
@@ -99,7 +99,7 @@ public final class CmdLineUtil {
    * time-consuming computation it could frustrate the user.
    *
    * @param name human-friendly file name. for example perceptron model
-   * @param outFile file
+   * @param outFile the particular {@link File} to check to qualify an output file
    */
   public static void checkOutputFile(String name, File outFile) {
 
@@ -168,7 +168,7 @@ public final class CmdLineUtil {
    * Writes a {@link BaseModel} to disk. Occurring errors are printed to the console
    * to inform the user.
    *
-   * @param modelName type of the model, name is used in error messages.
+   * @param modelName name of the model, name is used in error messages.
    * @param modelFile output file of the model
    * @param model the model itself which should be written to disk
    */
@@ -201,11 +201,11 @@ public final class CmdLineUtil {
   }
 
   /**
-   * Returns the index of the parameter in the arguments, or -1 if the parameter is not found.
+   * Returns the index of the parameter in the arguments, or {@code -1} if the parameter is not found.
    *
    * @param param parameter name
    * @param args arguments
-   * @return the index of the parameter in the arguments, or -1 if the parameter is not found
+   * @return the index of the parameter in the arguments, or {@code -1} if the parameter is not found
    */
   public static int getParameterIndex(String param, String[] args) {
     for (int i = 0; i < args.length; i++) {
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/DetailedFMeasureListener.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/DetailedFMeasureListener.java
index d89f975d..5f675017 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/DetailedFMeasureListener.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/DetailedFMeasureListener.java
@@ -38,8 +38,7 @@ import opennlp.tools.util.eval.EvaluationMonitor;
  * <b>Note:</b> Do not use this class, internal use only!
  */
 @Internal
-public abstract class DetailedFMeasureListener<T> implements
-    EvaluationMonitor<T> {
+public abstract class DetailedFMeasureListener<T> implements EvaluationMonitor<T> {
 
   private int samples = 0;
   private final Stats generalStats = new Stats();
@@ -251,8 +250,8 @@ public abstract class DetailedFMeasureListener<T> implements
 
     /**
      * Retrieves the f-measure score.
-     *
-     * f-measure = 2 * precision * recall / (precision + recall)
+     * <p>
+     * {@code f-measure = 2 * precision * recall / (precision + recall)}
      *
      * @return the f-measure or -1 if precision + recall <= 0
      */
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/EvaluationErrorPrinter.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/EvaluationErrorPrinter.java
index 81130e57..c9f9b513 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/EvaluationErrorPrinter.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/EvaluationErrorPrinter.java
@@ -193,10 +193,8 @@ public abstract class EvaluationErrorPrinter<T> implements EvaluationMonitor<T>
   /**
    * Auxiliary method to print expected and predicted samples.
    *
-   * @param referenceSample
-   *          the reference sample
-   * @param predictedSample
-   *          the predicted sample
+   * @param referenceSample The {@link S} from the references.
+   * @param predictedSample The {@link S} of the predictions.
    */
   private <S> void printSamples(S referenceSample, S predictedSample) {
     String details = "Expected: {\n" + referenceSample + "}\nPredicted: {\n"
@@ -208,12 +206,10 @@ public abstract class EvaluationErrorPrinter<T> implements EvaluationMonitor<T>
    * Outputs falseNegatives and falsePositives spans from the references and
    * predictions list.
    *
-   * @param references
-   * @param predictions
-   * @param falseNegatives
-   *          [out] the false negatives list
-   * @param falsePositives
-   *          [out] the false positives list
+   * @param references The {@link Span spans} from the references.
+   * @param predictions The {@link Span spans} of the predictions.
+   * @param falseNegatives The false negatives list.
+   * @param falsePositives The false positives list.
    */
   private void findErrors(Span[] references, Span[] predictions,
       List<Span> falseNegatives, List<Span> falsePositives) {
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/FineGrainedReportListener.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/FineGrainedReportListener.java
index f1fbc032..e773f182 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/FineGrainedReportListener.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/FineGrainedReportListener.java
@@ -172,7 +172,7 @@ public abstract class FineGrainedReportListener {
   }
 
   private String matrixToString(SortedSet<String> tagset, double[][] data, boolean filter) {
-    // we dont want to print trivial cases (acc=1)
+    // we don't want to print trivial cases (acc=1)
     int initialIndex = 0;
     String[] tags = tagset.toArray(new String[tagset.size()]);
     StringBuilder sb = new StringBuilder();
@@ -238,7 +238,7 @@ public abstract class FineGrainedReportListener {
     printFooter("Evaluation Corpus Statistics");
   }
 
-  protected void printTokenOcurrenciesRank() {
+  protected void printTokenOccurrencesRank() {
     printHeader("Most frequent tokens");
 
     SortedSet<String> toks = getTokensOrderedByFrequency();
@@ -267,9 +267,9 @@ public abstract class FineGrainedReportListener {
     tokIterator = toks.iterator();
     while (tokIterator.hasNext() && count++ < maxLines) {
       String tok = tokIterator.next();
-      int ocurrencies = getTokenFrequency(tok);
+      int frequency = getTokenFrequency(tok);
 
-      printStream.append(String.format(format, count, ocurrencies, tok)
+      printStream.append(String.format(format, count, frequency, tok)
 
       ).append("\n");
     }
@@ -448,7 +448,7 @@ public abstract class FineGrainedReportListener {
    */
   public static class MatrixLabelComparator implements Comparator<String> {
 
-    private Map<String, ConfusionMatrixLine> confusionMatrix;
+    private final Map<String, ConfusionMatrixLine> confusionMatrix;
 
     public MatrixLabelComparator(Map<String, ConfusionMatrixLine> confusionMatrix) {
       this.confusionMatrix = confusionMatrix;
@@ -711,9 +711,7 @@ public abstract class FineGrainedReportListener {
     }
 
     /**
-     * Gets the calculated accuracy of this element
-     *
-     * @return the accuracy
+     * @return Retrieves the calculated accuracy of this element
      */
     public double getAccuracy() {
       // we save the accuracy because it is frequently used by the comparator
@@ -726,11 +724,8 @@ public abstract class FineGrainedReportListener {
     }
 
     /**
-     * Gets the value given a column
-     *
-     * @param column
-     *          the column
-     * @return the counter value
+     * @param column The column to retrieve the counter value for.
+     * @return Retrieves the counter value for the given {@code column}.
      */
     public int getValue(String column) {
       Counter c = line.get(column);
@@ -762,10 +757,10 @@ public abstract class FineGrainedReportListener {
     private final Mean averageSentenceLength = new Mean();
     // token statistics
     private final Map<String, Mean> tokAccuracies = new HashMap<>();
-    private final Map<String, Counter> tokOcurrencies = new HashMap<>();
+    private final Map<String, Counter> tokOccurrences = new HashMap<>();
     private final Map<String, Counter> tokErrors = new HashMap<>();
     // tag statistics
-    private final Map<String, Counter> tagOcurrencies = new HashMap<>();
+    private final Map<String, Counter> tagOccurrences = new HashMap<>();
     private final Map<String, Counter> tagErrors = new HashMap<>();
     private final Map<String, FMeasure> tagFMeasure = new HashMap<>();
     // represents a Confusion Matrix that aggregates all tokens
@@ -825,7 +820,7 @@ public abstract class FineGrainedReportListener {
 
 
     /**
-     * Includes a new evaluation data
+     * Includes new evaluation data.
      *
      * @param tok
      *          the evaluated token
@@ -838,17 +833,17 @@ public abstract class FineGrainedReportListener {
       // token stats
       if (!tokAccuracies.containsKey(tok)) {
         tokAccuracies.put(tok, new Mean());
-        tokOcurrencies.put(tok, new Counter());
+        tokOccurrences.put(tok, new Counter());
         tokErrors.put(tok, new Counter());
       }
-      tokOcurrencies.get(tok).increment();
+      tokOccurrences.get(tok).increment();
 
       // tag stats
-      if (!tagOcurrencies.containsKey(ref)) {
-        tagOcurrencies.put(ref, new Counter());
+      if (!tagOccurrences.containsKey(ref)) {
+        tagOccurrences.put(ref, new Counter());
         tagErrors.put(ref, new Counter());
       }
-      tagOcurrencies.get(ref).increment();
+      tagOccurrences.get(ref).increment();
 
       // updates general, token and tag error stats
       if (ref.equals(pred)) {
@@ -896,7 +891,7 @@ public abstract class FineGrainedReportListener {
         if (!this.tagFMeasure.containsKey(tag)) {
           this.tagFMeasure.put(tag, new FMeasure());
         }
-        // populate the fmeasure
+        // populate the F-measure
         this.tagFMeasure.get(tag).updateScores(
             reference.toArray(new Span[reference.size()]),
             prediction.toArray(new Span[prediction.size()]));
@@ -908,7 +903,7 @@ public abstract class FineGrainedReportListener {
     }
 
     private int getNumberOfTags() {
-      return this.tagOcurrencies.keySet().size();
+      return this.tagOccurrences.keySet().size();
     }
 
     private long getNumberOfSentences() {
@@ -936,12 +931,12 @@ public abstract class FineGrainedReportListener {
     }
 
     private int getTokenFrequency(String token) {
-      return tokOcurrencies.get(token).value();
+      return tokOccurrences.get(token).value();
     }
 
     private SortedSet<String> getTokensOrderedByFrequency() {
-      SortedSet<String> toks = new TreeSet<>(new SimpleLabelComparator(tokOcurrencies));
-      toks.addAll(tokOcurrencies.keySet());
+      SortedSet<String> toks = new TreeSet<>(new SimpleLabelComparator(tokOccurrences));
+      toks.addAll(tokOccurrences.keySet());
       return Collections.unmodifiableSortedSet(toks);
     }
 
@@ -952,7 +947,7 @@ public abstract class FineGrainedReportListener {
     }
 
     private int getTagFrequency(String tag) {
-      return tagOcurrencies.get(tag).value();
+      return tagOccurrences.get(tag).value();
     }
 
     private int getTagErrors(String tag) {
@@ -996,7 +991,7 @@ public abstract class FineGrainedReportListener {
     }
 
     /**
-     * Creates a matrix with N lines and N + 1 columns with the data from
+     * Creates a matrix with {@code N} lines and {@code N + 1} columns with the data from
      * confusion matrix. The last column is the accuracy.
      */
     private double[][] createConfusionMatrix(SortedSet<String> tagset,
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/GenerateManualTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/GenerateManualTool.java
index 7fcdfc5b..16458637 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/GenerateManualTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/GenerateManualTool.java
@@ -55,7 +55,7 @@ public class GenerateManualTool {
 
       if (!packageNameToolMap.containsKey(packageName)) {
         packageNameToolMap.put(packageName,
-            new LinkedHashMap<String, CmdLineTool>());
+            new LinkedHashMap<>());
       }
       packageNameToolMap.get(packageName).put(toolName, tool);
     }
@@ -85,9 +85,9 @@ public class GenerateManualTool {
   /**
    * Appends a group of tools, based on the tool package name
    *
-   * @param groupName
-   * @param toolsMap
-   * @param sb
+   * @param groupName The groupName to use.
+   * @param toolsMap  The {@link Map} of all cmd-line tools available.
+   * @param sb The {@link StringBuilder} to fill.
    */
   private static void appendToolGroup(String groupName,
       Map<String, CmdLineTool> toolsMap, StringBuilder sb) {
@@ -103,12 +103,12 @@ public class GenerateManualTool {
   }
 
   /**
-   * Appends a tool
+   * Appends a tool.
    *
-   * @param groupName
-   * @param toolName
-   * @param tool
-   * @param sb
+   * @param groupName The groupName to use.
+   * @param toolName  The name of the tool to use.
+   * @param tool  The {@link CmdLineTool} to append.
+   * @param sb The {@link StringBuilder} to fill.
    */
   private static void appendTool(String groupName, String toolName,
       CmdLineTool tool, StringBuilder sb) {
@@ -185,7 +185,7 @@ public class GenerateManualTool {
   private static void appendHeader(StringBuilder sb) {
     sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
         + "<!DOCTYPE chapter PUBLIC \"-//OASIS//DTD DocBook XML V4.4//EN\"\n"
-        + "\"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd\"[\n"
+        + "\"https://docbook.org/xml/4.4/docbookx.dtd\"[\n"
         + "]>\n" + "<!--\n"
         + "Licensed to the Apache Software Foundation (ASF) under one\n"
         + "or more contributor license agreements.  See the NOTICE file\n"
@@ -194,7 +194,7 @@ public class GenerateManualTool {
         + "to you under the Apache License, Version 2.0 (the\n"
         + "\"License\"); you may not use this file except in compliance\n"
         + "with the License.  You may obtain a copy of the License at\n" + "\n"
-        + "   http://www.apache.org/licenses/LICENSE-2.0\n" + "\n"
+        + "   https://www.apache.org/licenses/LICENSE-2.0\n" + "\n"
         + "Unless required by applicable law or agreed to in writing,\n"
         + "software distributed under the License is distributed on an\n"
         + "\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n"
@@ -239,9 +239,6 @@ public class GenerateManualTool {
 
   /**
    * Prevents long lines. Lines are optimized for printing.
-   *
-   * @param stringBlock
-   * @return
    */
   private static String splitLongLines(String stringBlock) {
     StringBuilder sb = new StringBuilder();
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/ObjectStreamFactory.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/ObjectStreamFactory.java
index 27fe710d..e60a6392 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/ObjectStreamFactory.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/ObjectStreamFactory.java
@@ -22,19 +22,15 @@ import opennlp.tools.util.ObjectStream;
 public interface ObjectStreamFactory<T,P> {
 
   /**
-   * Returns interface with parameters description.
-   *
-   * @param <P> interfaces which describes the parameters.
-   *
-   * @return interface with parameters description
+   * @return Retrieves interface with parameters description.
    */
   Class<P> getParameters();
 
   /**
-   * Creates the {@link ObjectStream}.
+   * Creates an {@link ObjectStream} of the template type {@code T}.
    *
    * @param args arguments
-   * @return ObjectStream instance
+   * @return The created {@link ObjectStream} instance.
    */
   ObjectStream<T> create(String[] args);
 }
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/SystemInputStreamFactory.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/SystemInputStreamFactory.java
index d9f8d3ff..5958fa69 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/SystemInputStreamFactory.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/SystemInputStreamFactory.java
@@ -17,7 +17,6 @@
 
 package opennlp.tools.cmdline;
 
-import java.io.IOException;
 import java.io.InputStream;
 import java.nio.charset.Charset;
 
@@ -32,7 +31,7 @@ public class SystemInputStreamFactory implements InputStreamFactory {
   }
 
   @Override
-  public InputStream createInputStream() throws IOException {
+  public InputStream createInputStream() {
 
     if (!isTainted) {
       isTainted = true;
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/TerminateToolException.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/TerminateToolException.java
index 72421a20..b2f49563 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/TerminateToolException.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/TerminateToolException.java
@@ -26,9 +26,9 @@ import opennlp.tools.commons.Internal;
  * the specified error code, instead of just calling {@link System#exit(int)}.
  * <p>
  * The return code convention is to return:<br>
- * 0 in case of graceful termination<br>
- * -1 in case of runtime errors, such as IOException<br>
- * 1 in case of invalid parameters.
+ * {@code 0} in case of graceful termination<br>
+ * {@code -1} in case of runtime errors, such as {@link java.io.IOException}<br>
+ * {@code 1} in case of invalid parameters.
  * <p>
  * <b>Note:</b> Do not use this class, internal use only!
  */
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/TypedCmdLineTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/TypedCmdLineTool.java
index e3f8cbe2..c4f74c41 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/TypedCmdLineTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/TypedCmdLineTool.java
@@ -20,11 +20,10 @@ package opennlp.tools.cmdline;
 import java.util.Map;
 
 /**
- * Base class for tools which support processing of samples of some type T
+ * Base class for tools which support processing of samples of some type {@link T}
  * coming from a stream of a certain format.
  */
-public abstract class TypedCmdLineTool<T, P>
-    extends CmdLineTool {
+public abstract class TypedCmdLineTool<T, P> extends CmdLineTool {
 
   /**
    * variable to access the type of the generic parameter.
@@ -44,7 +43,7 @@ public abstract class TypedCmdLineTool<T, P>
    * Returns stream factory for the type of this tool for the <code>format</code>.
    *
    * @param format data format name
-   * @return stream factory for the type of this tool for the format
+   * @return The {@link ObjectStreamFactory factory} for the type of this tool for the format.
    */
   protected ObjectStreamFactory<T, P> getStreamFactory(String format) {
     ObjectStreamFactory<T, P> factory = StreamFactoryRegistry.getFactory(type, format);
@@ -56,26 +55,26 @@ public abstract class TypedCmdLineTool<T, P>
   }
 
   /**
-   * Validates arguments using parameters from <code>argProxyInterface</code> and the parameters of the
+   * Validates arguments using parameters from {@code argProxyInterface} and the parameters of the
    * <code>format</code>.
    *
    * @param args arguments
    * @param argProxyInterface interface with parameter descriptions
    * @param format data format name
-   * @param <A> A
+   * @param <A> The generic type.
    */
   protected <A> void validateAllArgs(String[] args, Class<A> argProxyInterface, String format) {
     ObjectStreamFactory<T, P> factory = getStreamFactory(format);
     String errMessage = ArgumentParser.validateArgumentsLoudly(args, argProxyInterface,
-        factory.<A>getParameters());
+        factory.getParameters());
     if (null != errMessage) {
       throw new TerminateToolException(1, errMessage + "\n" + getHelp(format));
     }
   }
 
   /**
-   * Validates arguments for a format processed by the <code>factory</code>.
-   * @param factory a stream factory
+   * Validates arguments for a format processed by the {@code factory}.
+   * @param factory The {@link ObjectStreamFactory factory} to use.
    * @param args arguments
    */
   protected void validateFactoryArgs(ObjectStreamFactory<T, P> factory, String[] args) {
@@ -119,10 +118,8 @@ public abstract class TypedCmdLineTool<T, P>
   public abstract void run(String format, String[] args);
 
   /**
-   * Retrieves a description on how to use the tool.
-   *
    * @param format data format
-   * @return a description on how to use the tool
+   * @return Retrieves a description on how to use the tool.
    */
   public abstract String getHelp(String format);
 }
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkEvaluationErrorListener.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkEvaluationErrorListener.java
index d091fa9b..7c33289c 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkEvaluationErrorListener.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkEvaluationErrorListener.java
@@ -33,7 +33,7 @@ public class ChunkEvaluationErrorListener extends
     EvaluationErrorPrinter<ChunkSample> implements ChunkerEvaluationMonitor {
 
   /**
-   * Creates a listener that will print to System.err
+   * Creates a listener that will print to {@code System.err}.
    */
   public ChunkEvaluationErrorListener() {
     super(System.err);
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkerConverterTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkerConverterTool.java
index f001f290..f5b9633a 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkerConverterTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkerConverterTool.java
@@ -24,6 +24,9 @@ import opennlp.tools.cmdline.params.BasicFormatParams;
 /**
  * Tool to convert multiple data formats into native OpenNLP chunker training
  * format.
+ *
+ * @see AbstractConverterTool
+ * @see ChunkSample
  */
 public class ChunkerConverterTool extends AbstractConverterTool<ChunkSample, BasicFormatParams> {
 
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkerEvaluatorTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkerEvaluatorTool.java
index c247f6e5..a49c399f 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkerEvaluatorTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkerEvaluatorTool.java
@@ -35,6 +35,13 @@ import opennlp.tools.cmdline.params.EvaluatorParams;
 import opennlp.tools.util.ObjectStream;
 import opennlp.tools.util.eval.EvaluationMonitor;
 
+/**
+ * A default {@link ChunkSample}-centric implementation of {@link AbstractEvaluatorTool}
+ * that prints to an output stream.
+ *
+ * @see AbstractEvaluatorTool
+ * @see EvalToolParams
+ */
 public final class ChunkerEvaluatorTool
     extends AbstractEvaluatorTool<ChunkSample, EvalToolParams> {
 
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/TrainingParams.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/TrainingParams.java
index 651427bb..a4153b09 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/TrainingParams.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/TrainingParams.java
@@ -23,7 +23,7 @@ import opennlp.tools.cmdline.params.BasicTrainingParams;
 import opennlp.tools.commons.Internal;
 
 /**
- * TrainingParams for Chunker.
+ * TrainingParams for Chunker tools.
  * <p>
  * <b>Note:</b> Do not use this class, internal use only!
  */
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/DoccatConverterTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/DoccatConverterTool.java
index d7c25c94..023337ac 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/DoccatConverterTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/DoccatConverterTool.java
@@ -21,6 +21,13 @@ import opennlp.tools.cmdline.AbstractConverterTool;
 import opennlp.tools.cmdline.params.BasicFormatParams;
 import opennlp.tools.doccat.DocumentSample;
 
+/**
+ * Tool to convert multiple data formats into native OpenNLP doccat training
+ * format.
+ *
+ * @see AbstractConverterTool
+ * @see DocumentSample
+ */
 public class DoccatConverterTool extends AbstractConverterTool<DocumentSample, BasicFormatParams> {
 
   public DoccatConverterTool() {
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/DoccatEvaluatorTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/DoccatEvaluatorTool.java
index 0c57a73b..f355f381 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/DoccatEvaluatorTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/DoccatEvaluatorTool.java
@@ -40,6 +40,13 @@ import opennlp.tools.doccat.DocumentSample;
 import opennlp.tools.util.ObjectStream;
 import opennlp.tools.util.eval.EvaluationMonitor;
 
+/**
+ * A default {@link DocumentSample}-centric implementation of {@link AbstractEvaluatorTool}
+ * that prints to an output stream.
+ *
+ * @see AbstractEvaluatorTool
+ * @see EvalToolParams
+ */
 public final class DoccatEvaluatorTool extends
     AbstractEvaluatorTool<DocumentSample, EvalToolParams> {
 
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/langdetect/LanguageDetectorConverterTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/langdetect/LanguageDetectorConverterTool.java
index a78e5805..168f9517 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/langdetect/LanguageDetectorConverterTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/langdetect/LanguageDetectorConverterTool.java
@@ -21,6 +21,13 @@ import opennlp.tools.cmdline.AbstractConverterTool;
 import opennlp.tools.cmdline.params.BasicFormatParams;
 import opennlp.tools.langdetect.LanguageSample;
 
+/**
+ * Tool to convert multiple data formats into native OpenNLP language detection
+ * training format.
+ *
+ * @see AbstractConverterTool
+ * @see LanguageSample
+ */
 public class LanguageDetectorConverterTool extends AbstractConverterTool<LanguageSample, BasicFormatParams> {
 
   public LanguageDetectorConverterTool() {
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/langdetect/LanguageDetectorEvaluatorTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/langdetect/LanguageDetectorEvaluatorTool.java
index f3c4c596..d944f21b 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/langdetect/LanguageDetectorEvaluatorTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/langdetect/LanguageDetectorEvaluatorTool.java
@@ -39,6 +39,13 @@ import opennlp.tools.langdetect.LanguageSample;
 import opennlp.tools.util.ObjectStream;
 import opennlp.tools.util.eval.EvaluationMonitor;
 
+/**
+ * A default {@link LanguageSample}-centric implementation of {@link AbstractEvaluatorTool}
+ * that prints to an output stream.
+ *
+ * @see AbstractEvaluatorTool
+ * @see EvalToolParams
+ */
 public final class LanguageDetectorEvaluatorTool extends
     AbstractEvaluatorTool<LanguageSample, LanguageDetectorEvaluatorTool.EvalToolParams> {
 
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/lemmatizer/LemmatizerEvaluatorTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/lemmatizer/LemmatizerEvaluatorTool.java
index cdcd8338..bc8e9f67 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/lemmatizer/LemmatizerEvaluatorTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/lemmatizer/LemmatizerEvaluatorTool.java
@@ -33,6 +33,13 @@ import opennlp.tools.lemmatizer.LemmatizerEvaluationMonitor;
 import opennlp.tools.lemmatizer.LemmatizerEvaluator;
 import opennlp.tools.lemmatizer.LemmatizerModel;
 
+/**
+ * A default {@link LemmaSample}-centric implementation of {@link AbstractEvaluatorTool}
+ * that prints to an output stream.
+ *
+ * @see AbstractEvaluatorTool
+ * @see EvalToolParams
+ */
 public final class LemmatizerEvaluatorTool
     extends AbstractEvaluatorTool<LemmaSample, LemmatizerEvaluatorTool.EvalToolParams> {
 
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/lemmatizer/LemmatizerFineGrainedReportListener.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/lemmatizer/LemmatizerFineGrainedReportListener.java
index 25daa95a..f4d19ab8 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/lemmatizer/LemmatizerFineGrainedReportListener.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/lemmatizer/LemmatizerFineGrainedReportListener.java
@@ -67,7 +67,7 @@ public class LemmatizerFineGrainedReportListener
     printGeneralStatistics();
     // token stats
     printTokenErrorRank();
-    printTokenOcurrenciesRank();
+    printTokenOccurrencesRank();
     // tag stats
     printTagsErrorRank();
     // confusion tables
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderConverterTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderConverterTool.java
index 18b71ad9..d157c7e0 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderConverterTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderConverterTool.java
@@ -22,8 +22,11 @@ import opennlp.tools.cmdline.params.BasicFormatParams;
 import opennlp.tools.namefind.NameSample;
 
 /**
- * Tool to convert multiple data formats into native OpenNLP name finder training
- * format.
+ * Tool to convert multiple data formats into native OpenNLP name finder
+ * training format.
+ *
+ * @see AbstractConverterTool
+ * @see NameSample
  */
 public class TokenNameFinderConverterTool extends AbstractConverterTool<NameSample, BasicFormatParams> {
 
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderEvaluatorTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderEvaluatorTool.java
index a089e687..87d91e18 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderEvaluatorTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderEvaluatorTool.java
@@ -44,6 +44,13 @@ import opennlp.tools.namefind.TokenNameFinderModel;
 import opennlp.tools.util.ObjectStream;
 import opennlp.tools.util.eval.EvaluationMonitor;
 
+/**
+ * A default {@link NameSample}-centric implementation of {@link AbstractEvaluatorTool}
+ * that prints to an output stream.
+ *
+ * @see AbstractEvaluatorTool
+ * @see EvalToolParams
+ */
 public final class TokenNameFinderEvaluatorTool
     extends AbstractEvaluatorTool<NameSample, EvalToolParams> {
 
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/params/DetailedFMeasureEvaluatorParams.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/params/DetailedFMeasureEvaluatorParams.java
index d370844a..a915b59c 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/params/DetailedFMeasureEvaluatorParams.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/params/DetailedFMeasureEvaluatorParams.java
@@ -33,7 +33,7 @@ public interface DetailedFMeasureEvaluatorParams {
   @ParameterDescription(valueName = "true|false",
       description = "if true (default) will print detailed FMeasure results.")
   @OptionalParameter(defaultValue = "true")
-  @Deprecated // this will be removed in 1.8.0
+  @Deprecated(forRemoval = true) // this will be removed in 1.8.0
   Boolean getDetailedF();
 
 }
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ModelUpdaterTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ModelUpdaterTool.java
index 2863a454..b61ec9a8 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ModelUpdaterTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ModelUpdaterTool.java
@@ -59,23 +59,16 @@ abstract class ModelUpdaterTool
     ObjectStreamFactory<Parse,ModelUpdaterParams> factory = getStreamFactory(format);
     String[] fargs = ArgumentParser.filter(args, factory.getParameters());
     validateFactoryArgs(factory, fargs);
-    ObjectStream<Parse> sampleStream = factory.create(fargs);
+    ;
 
     ParserModel updatedParserModel;
-    try {
+    try (ObjectStream<Parse> sampleStream = factory.create(fargs)) {
       updatedParserModel = trainAndUpdate(originalParserModel, sampleStream, params);
     }
     catch (IOException e) {
       throw new TerminateToolException(-1, "IO error while reading training data or indexing data: "
           + e.getMessage(), e);
     }
-    finally {
-      try {
-        sampleStream.close();
-      } catch (IOException e) {
-        // sorry that this can fail
-      }
-    }
 
     CmdLineUtil.writeModel("parser", modelFile, updatedParserModel);
   }
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserConverterTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserConverterTool.java
index 220e2a4a..ed3d1879 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserConverterTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserConverterTool.java
@@ -21,6 +21,13 @@ import opennlp.tools.cmdline.AbstractConverterTool;
 import opennlp.tools.cmdline.params.BasicFormatParams;
 import opennlp.tools.parser.Parse;
 
+/**
+ * Tool to convert multiple data formats into native OpenNLP parser
+ * format.
+ *
+ * @see AbstractConverterTool
+ * @see Parse
+ */
 public class ParserConverterTool extends AbstractConverterTool<Parse, BasicFormatParams> {
 
   public ParserConverterTool() {
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserEvaluatorTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserEvaluatorTool.java
index 8158f40c..d0a517a6 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserEvaluatorTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserEvaluatorTool.java
@@ -28,6 +28,13 @@ import opennlp.tools.parser.ParserEvaluator;
 import opennlp.tools.parser.ParserFactory;
 import opennlp.tools.parser.ParserModel;
 
+/**
+ * A default {@link Parse}-centric implementation of {@link AbstractEvaluatorTool}
+ * that prints to an output stream.
+ *
+ * @see AbstractEvaluatorTool
+ * @see EvaluatorParams
+ */
 public class ParserEvaluatorTool extends AbstractEvaluatorTool<Parse, EvaluatorParams> {
 
   public ParserEvaluatorTool() {
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserTool.java
index 8e9e683a..471c694a 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserTool.java
@@ -55,7 +55,7 @@ public final class ParserTool extends BasicCmdLineTool {
     return "Usage: " + CLI.CMD + " " + getName() + " [-bs n -ap n -k n -tk tok_model] model < sentences \n"
             + "-bs n: Use a beam size of n.\n"
             + "-ap f: Advance outcomes in with at least f% of the probability mass.\n"
-            + "-k n: Show the top n parses.  This will also display their log-probablities.\n"
+            + "-k n: Show the top n parses. This will also display their log-probabilities.\n"
             + "-tk tok_model: Use the specified tokenizer model to tokenize the sentences. "
             + "Defaults to a WhitespaceTokenizer.";
   }
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/TrainingParams.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/TrainingParams.java
index 56468c93..a25c901c 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/TrainingParams.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/TrainingParams.java
@@ -25,7 +25,7 @@ import opennlp.tools.cmdline.params.BasicTrainingParams;
 import opennlp.tools.commons.Internal;
 
 /**
- * TrainingParams for Parser.
+ * TrainingParams for {@link opennlp.tools.parser.Parser}.
  * <p>
  * <b>Note:</b> Do not use this class, internal use only!
  */
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerConverterTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerConverterTool.java
index 463f026f..f4146057 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerConverterTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerConverterTool.java
@@ -21,6 +21,13 @@ import opennlp.tools.cmdline.AbstractConverterTool;
 import opennlp.tools.cmdline.params.BasicFormatParams;
 import opennlp.tools.postag.POSSample;
 
+/**
+ * Tool to convert multiple data formats into native OpenNLP part of speech tagging
+ * training format.
+ *
+ * @see AbstractConverterTool
+ * @see POSSample
+ */
 public class POSTaggerConverterTool extends AbstractConverterTool<POSSample, BasicFormatParams> {
 
   public POSTaggerConverterTool() {
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerEvaluatorTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerEvaluatorTool.java
index 9b471cdf..96026ec3 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerEvaluatorTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerEvaluatorTool.java
@@ -34,6 +34,13 @@ import opennlp.tools.postag.POSModel;
 import opennlp.tools.postag.POSSample;
 import opennlp.tools.postag.POSTaggerEvaluationMonitor;
 
+/**
+ * A default {@link POSSample}-centric implementation of {@link AbstractEvaluatorTool}
+ * that prints to an output stream.
+ *
+ * @see AbstractEvaluatorTool
+ * @see EvalToolParams
+ */
 public final class POSTaggerEvaluatorTool
     extends AbstractEvaluatorTool<POSSample, EvalToolParams> {
 
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerFineGrainedReportListener.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerFineGrainedReportListener.java
index fe8f2b85..27f3b3ea 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerFineGrainedReportListener.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerFineGrainedReportListener.java
@@ -68,7 +68,7 @@ public class POSTaggerFineGrainedReportListener
     printGeneralStatistics();
     // token stats
     printTokenErrorRank();
-    printTokenOcurrenciesRank();
+    printTokenOccurrencesRank();
     // tag stats
     printTagsErrorRank();
     // confusion tables
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/SentenceDetectorConverterTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/SentenceDetectorConverterTool.java
index 5bbe711e..43aa63e0 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/SentenceDetectorConverterTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/SentenceDetectorConverterTool.java
@@ -21,6 +21,13 @@ import opennlp.tools.cmdline.AbstractConverterTool;
 import opennlp.tools.cmdline.params.BasicFormatParams;
 import opennlp.tools.sentdetect.SentenceSample;
 
+/**
+ * Tool to convert multiple data formats into native OpenNLP sentence detector
+ * training format.
+ *
+ * @see AbstractConverterTool
+ * @see SentenceSample
+ */
 public class SentenceDetectorConverterTool extends AbstractConverterTool<SentenceSample, BasicFormatParams> {
 
   public SentenceDetectorConverterTool() {
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/SentenceDetectorEvaluatorTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/SentenceDetectorEvaluatorTool.java
index dbc80ef0..f4787be4 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/SentenceDetectorEvaluatorTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/SentenceDetectorEvaluatorTool.java
@@ -29,6 +29,13 @@ import opennlp.tools.sentdetect.SentenceDetectorME;
 import opennlp.tools.sentdetect.SentenceModel;
 import opennlp.tools.sentdetect.SentenceSample;
 
+/**
+ * A default {@link SentenceSample}-centric implementation of {@link AbstractEvaluatorTool}
+ * that prints to an output stream.
+ *
+ * @see AbstractEvaluatorTool
+ * @see EvalToolParams
+ */
 public final class SentenceDetectorEvaluatorTool
     extends AbstractEvaluatorTool<SentenceSample, EvalToolParams> {
 
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/SentenceDetectorTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/SentenceDetectorTool.java
index 46fa2f02..f2a518f7 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/SentenceDetectorTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/SentenceDetectorTool.java
@@ -47,7 +47,7 @@ public final class SentenceDetectorTool extends BasicCmdLineTool {
   }
 
   /**
-   * Perform sentence detection the input stream.
+   * Perform sentence detection on a stream of sentences.
    * <p>
    * A newline will be treated as a paragraph boundary.
    */
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/tokenizer/TokenizerConverterTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/tokenizer/TokenizerConverterTool.java
index 9f4f1c30..a3002a58 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/tokenizer/TokenizerConverterTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/tokenizer/TokenizerConverterTool.java
@@ -21,6 +21,13 @@ import opennlp.tools.cmdline.AbstractConverterTool;
 import opennlp.tools.cmdline.params.BasicFormatParams;
 import opennlp.tools.tokenize.TokenSample;
 
+/**
+ * Tool to convert multiple data formats into native OpenNLP sentence detector
+ * training format.
+ *
+ * @see AbstractConverterTool
+ * @see TokenSample
+ */
 public class TokenizerConverterTool extends AbstractConverterTool<TokenSample, BasicFormatParams> {
 
   public TokenizerConverterTool() {
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/tokenizer/TokenizerMEEvaluatorTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/tokenizer/TokenizerMEEvaluatorTool.java
index 0e12039c..a177619b 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/tokenizer/TokenizerMEEvaluatorTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/tokenizer/TokenizerMEEvaluatorTool.java
@@ -28,6 +28,13 @@ import opennlp.tools.tokenize.TokenizerEvaluationMonitor;
 import opennlp.tools.tokenize.TokenizerEvaluator;
 import opennlp.tools.tokenize.TokenizerModel;
 
+/**
+ * A default {@link TokenSample}-centric implementation of {@link AbstractEvaluatorTool}
+ * that prints to an output stream.
+ *
+ * @see AbstractEvaluatorTool
+ * @see EvalToolParams
+ */
 public final class TokenizerMEEvaluatorTool
     extends AbstractEvaluatorTool<TokenSample, EvalToolParams> {