You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by jo...@apache.org on 2017/01/11 22:55:45 UTC
[3/3] opennlp git commit: OPENNLP-923: Wrap all lines longer than 110
chars
OPENNLP-923: Wrap all lines longer than 110 chars
And also add checkstyle enforcement
Project: http://git-wip-us.apache.org/repos/asf/opennlp/repo
Commit: http://git-wip-us.apache.org/repos/asf/opennlp/commit/2e1f7e75
Tree: http://git-wip-us.apache.org/repos/asf/opennlp/tree/2e1f7e75
Diff: http://git-wip-us.apache.org/repos/asf/opennlp/diff/2e1f7e75
Branch: refs/heads/master
Commit: 2e1f7e759bac3d12aa21e39bbf97fb51ddeaa86d
Parents: f295b18
Author: J�rn Kottmann <jo...@apache.org>
Authored: Wed Jan 11 22:40:03 2017 +0100
Committer: J�rn Kottmann <jo...@apache.org>
Committed: Wed Jan 11 23:54:20 2017 +0100
----------------------------------------------------------------------
checkstyle-suppressions.xml | 2 +-
checkstyle.xml | 8 +-
.../opennlp/bratann/NameFinderAnnService.java | 6 +-
.../MorfologikDictionaryBuilderParams.java | 6 +-
.../java/opennlp/tools/chunker/ChunkSample.java | 10 ++-
.../tools/chunker/ChunkerContextGenerator.java | 6 +-
.../java/opennlp/tools/chunker/ChunkerME.java | 7 +-
.../chunker/DefaultChunkerContextGenerator.java | 3 +-
.../opennlp/tools/cmdline/ArgumentParser.java | 22 +++--
.../java/opennlp/tools/cmdline/CmdLineUtil.java | 3 +-
.../tools/cmdline/GenerateManualTool.java | 12 ++-
.../tools/cmdline/PerformanceMonitor.java | 4 +-
.../tools/cmdline/SystemInputStreamFactory.java | 3 +-
.../tools/cmdline/chunker/ChunkerMETool.java | 6 +-
.../tools/cmdline/chunker/TrainingParams.java | 3 +-
.../dictionary/DictionaryBuilderTool.java | 3 +-
.../tools/cmdline/doccat/DoccatTool.java | 4 +-
.../tools/cmdline/doccat/TrainingParams.java | 9 +-
.../cmdline/entitylinker/EntityLinkerTool.java | 3 +-
.../cmdline/lemmatizer/TrainingParams.java | 4 +-
.../TokenNameFinderCrossValidatorTool.java | 3 +-
.../cmdline/namefind/TokenNameFinderTool.java | 4 +-
.../namefind/TokenNameFinderTrainerTool.java | 6 +-
.../tools/cmdline/parser/ParserTool.java | 8 +-
.../tools/cmdline/parser/ParserTrainerTool.java | 3 +-
.../tools/cmdline/postag/POSTaggerTool.java | 3 +-
.../tools/cmdline/postag/TrainingParams.java | 12 ++-
.../sentdetect/SentenceDetectorTool.java | 4 +-
.../cmdline/sentdetect/TrainingParams.java | 3 +-
.../tools/cmdline/tokenizer/TrainingParams.java | 6 +-
.../serializer/DictionarySerializer.java | 3 +-
.../doccat/DocumentCategorizerEventStream.java | 3 +-
.../tools/doccat/DocumentSampleStream.java | 6 +-
.../tools/doccat/NGramFeatureGenerator.java | 6 +-
.../tools/entitylinker/EntityLinker.java | 3 +-
.../tools/entitylinker/EntityLinkerFactory.java | 3 +-
.../opennlp/tools/entitylinker/LinkedSpan.java | 3 +-
.../formats/BioNLP2004NameSampleStream.java | 3 +-
.../tools/formats/Conll02NameSampleStream.java | 3 +-
.../tools/formats/Conll03NameSampleStream.java | 3 +-
.../tools/formats/ConllXPOSSampleStream.java | 3 +-
.../tools/formats/EvalitaNameSampleStream.java | 3 +-
.../formats/LeipzigDoccatSampleStream.java | 6 +-
.../tools/formats/ad/ADNameSampleStream.java | 3 +-
.../formats/ad/ADNameSampleStreamFactory.java | 3 +-
.../formats/ad/ADPOSSampleStreamFactory.java | 6 +-
.../ad/ADSentenceSampleStreamFactory.java | 3 +-
.../formats/brat/BratNameSampleStream.java | 5 +-
.../convert/NameToSentenceSampleStream.java | 3 +-
.../convert/ParseToPOSSampleStreamFactory.java | 3 +-
.../ConstitParseSampleStreamFactory.java | 4 +-
.../muc/Muc6NameSampleStreamFactory.java | 3 +-
.../OntoNotesNameSampleStreamFactory.java | 5 +-
.../tools/languagemodel/NGramLanguageModel.java | 7 +-
.../DefaultLemmatizerContextGenerator.java | 3 +-
.../opennlp/tools/lemmatizer/LemmaSample.java | 3 +-
.../lemmatizer/LemmaSampleEventStream.java | 3 +-
.../lemmatizer/LemmatizerContextGenerator.java | 6 +-
.../opennlp/tools/lemmatizer/LemmatizerME.java | 7 +-
.../main/java/opennlp/tools/ml/BeamSearch.java | 7 +-
.../opennlp/tools/ml/maxent/GISTrainer.java | 18 ++--
.../tools/ml/model/AbstractDataIndexer.java | 8 +-
.../opennlp/tools/ml/model/AbstractModel.java | 11 ++-
.../tools/ml/model/AbstractModelReader.java | 2 +-
.../opennlp/tools/ml/model/EvalParameters.java | 3 +-
.../opennlp/tools/ml/model/MutableContext.java | 3 +-
.../ml/model/OnePassRealValueDataIndexer.java | 6 +-
.../tools/ml/model/PlainTextFileDataReader.java | 3 +-
.../ml/model/SequenceClassificationModel.java | 4 +-
.../tools/ml/model/TwoPassDataIndexer.java | 3 +-
.../tools/ml/naivebayes/LogProbabilities.java | 10 ++-
.../tools/ml/naivebayes/LogProbability.java | 9 +-
.../ml/naivebayes/NaiveBayesEvalParameters.java | 3 +-
.../tools/ml/naivebayes/NaiveBayesModel.java | 23 +++--
.../tools/ml/naivebayes/Probabilities.java | 3 +-
.../tools/ml/naivebayes/Probability.java | 6 +-
.../tools/ml/perceptron/PerceptronModel.java | 6 +-
.../SimplePerceptronSequenceTrainer.java | 26 ++++--
.../BilouNameFinderSequenceValidator.java | 3 +-
.../namefind/DefaultNameContextGenerator.java | 11 ++-
.../tools/namefind/DocumentNameFinder.java | 5 +-
.../tools/namefind/NameContextGenerator.java | 6 +-
.../tools/namefind/NameFinderEventStream.java | 14 +--
.../opennlp/tools/namefind/NameFinderME.java | 3 +-
.../namefind/NameSampleSequenceStream.java | 6 +-
.../tools/namefind/RegexNameFinderFactory.java | 29 ++++--
.../opennlp/tools/namefind/TokenNameFinder.java | 4 +-
.../namefind/TokenNameFinderCrossValidator.java | 3 +-
.../namefind/TokenNameFinderEvaluator.java | 3 +-
.../tools/namefind/TokenNameFinderFactory.java | 8 +-
.../opennlp/tools/ngram/NGramGenerator.java | 6 +-
.../java/opennlp/tools/ngram/NGramModel.java | 3 +-
.../java/opennlp/tools/ngram/NGramUtils.java | 16 ++--
.../tools/parser/AbstractBottomUpParser.java | 69 ++++++++------
.../tools/parser/AbstractContextGenerator.java | 94 +++++++++++++-------
.../tools/parser/AbstractParserEventStream.java | 7 +-
.../main/java/opennlp/tools/parser/Parse.java | 32 ++++---
.../main/java/opennlp/tools/parser/Parser.java | 16 ++--
.../tools/parser/ParserCrossValidator.java | 4 +-
.../parser/chunking/CheckContextGenerator.java | 8 +-
.../opennlp/tools/parser/chunking/Parser.java | 44 ++++++---
.../parser/chunking/ParserEventStream.java | 15 ++--
.../opennlp/tools/parser/lang/en/HeadRules.java | 12 +--
.../parser/lang/es/AncoraSpanishHeadRules.java | 17 ++--
.../treeinsert/CheckContextGenerator.java | 1 -
.../opennlp/tools/parser/treeinsert/Parser.java | 58 ++++++++----
.../postag/DefaultPOSContextGenerator.java | 9 +-
.../java/opennlp/tools/postag/POSTaggerME.java | 4 +-
.../sentdetect/DefaultSDContextGenerator.java | 3 +-
.../tools/sentdetect/SDCrossValidator.java | 9 +-
.../sentdetect/SentenceDetectorEvaluator.java | 3 +-
.../tools/sentdetect/SentenceDetectorME.java | 4 +-
.../opennlp/tools/sentdetect/SentenceModel.java | 4 +-
.../tools/sentdetect/SentenceSampleStream.java | 3 +-
.../opennlp/tools/tokenize/TokenSample.java | 3 +-
.../tools/tokenize/TokenizerFactory.java | 3 +-
.../tokenize/lang/en/TokenSampleStream.java | 9 +-
.../tools/util/BeamSearchContextGenerator.java | 3 +-
.../main/java/opennlp/tools/util/Sequence.java | 3 +-
.../java/opennlp/tools/util/StringUtil.java | 33 ++++---
.../featuregen/BrownBigramFeatureGenerator.java | 6 +-
.../tools/util/featuregen/GeneratorFactory.java | 19 ++--
.../util/featuregen/WindowFeatureGenerator.java | 6 +-
.../featuregen/WordClusterFeatureGenerator.java | 5 +-
.../opennlp/tools/util/model/BaseModel.java | 5 +-
.../opennlp/tools/util/model/ModelUtil.java | 14 +--
.../main/java/opennlp/uima/chunker/Chunker.java | 6 +-
.../opennlp/uima/chunker/ChunkerTrainer.java | 6 +-
.../uima/namefind/AbstractNameFinder.java | 6 +-
.../uima/namefind/NameFinderTrainer.java | 29 +++---
.../java/opennlp/uima/postag/POSTagger.java | 3 +-
.../sentdetect/SentenceDetectorTrainer.java | 3 +-
132 files changed, 733 insertions(+), 410 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/checkstyle-suppressions.xml
----------------------------------------------------------------------
diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml
index 0e08e99..0f578c4 100644
--- a/checkstyle-suppressions.xml
+++ b/checkstyle-suppressions.xml
@@ -25,4 +25,4 @@
<suppressions>
<suppress files="opennlp[\\/]tools[\\/]stemmer[\\/]snowball[\\/]" checks="[a-zA-Z0-9]*"/>
<suppress files="PorterStemmer.java" checks="[a-zA-Z0-9]*"/>
-</suppressions>
\ No newline at end of file
+</suppressions>
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/checkstyle.xml
----------------------------------------------------------------------
diff --git a/checkstyle.xml b/checkstyle.xml
index 143b1f0..2fac7e2 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -51,10 +51,10 @@
<property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message" value="Avoid using corresponding octal or Unicode escape."/>
</module>
- <!--<module name="LineLength">-->
- <!--<property name="max" value="110"/>-->
- <!--<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>-->
- <!--</module>-->
+ <module name="LineLength">
+ <property name="max" value="110"/>
+ <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
+ </module>
<module name="AvoidStarImport"/>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap"/>
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-brat-annotator/src/main/java/opennlp/bratann/NameFinderAnnService.java
----------------------------------------------------------------------
diff --git a/opennlp-brat-annotator/src/main/java/opennlp/bratann/NameFinderAnnService.java b/opennlp-brat-annotator/src/main/java/opennlp/bratann/NameFinderAnnService.java
index 7482e0f..41c3d37 100644
--- a/opennlp-brat-annotator/src/main/java/opennlp/bratann/NameFinderAnnService.java
+++ b/opennlp-brat-annotator/src/main/java/opennlp/bratann/NameFinderAnnService.java
@@ -48,9 +48,9 @@ public class NameFinderAnnService {
if (args.length == 0) {
System.out.println("Usage:");
- System.out.println(
- "[NameFinderAnnService -serverPort port] [-tokenizerModel file] [-ruleBasedTokenizer whitespace|simple] " +
- "[-sentenceDetectorModel file] namefinderFile|nameFinderURI");
+ System.out.println("[NameFinderAnnService -serverPort port] [-tokenizerModel file] "
+ + "[-ruleBasedTokenizer whitespace|simple] "
+ + "[-sentenceDetectorModel file] namefinderFile|nameFinderURI");
return;
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-morfologik-addon/src/main/java/opennlp/morfologik/cmdline/builder/MorfologikDictionaryBuilderParams.java
----------------------------------------------------------------------
diff --git a/opennlp-morfologik-addon/src/main/java/opennlp/morfologik/cmdline/builder/MorfologikDictionaryBuilderParams.java b/opennlp-morfologik-addon/src/main/java/opennlp/morfologik/cmdline/builder/MorfologikDictionaryBuilderParams.java
index 6d12c25..cdcbdeb 100644
--- a/opennlp-morfologik-addon/src/main/java/opennlp/morfologik/cmdline/builder/MorfologikDictionaryBuilderParams.java
+++ b/opennlp-morfologik-addon/src/main/java/opennlp/morfologik/cmdline/builder/MorfologikDictionaryBuilderParams.java
@@ -28,7 +28,8 @@ import opennlp.tools.cmdline.params.EncodingParameter;
*/
interface MorfologikDictionaryBuilderParams extends EncodingParameter {
- @ParameterDescription(valueName = "in", description = "The input file (base,inflected,tag). An associated metadata (*.info) file must exist.")
+ @ParameterDescription(valueName = "in",
+ description = "The input file (base,inflected,tag). An associated metadata (*.info) file must exist.")
File getInputFile();
@ParameterDescription(valueName = "true|false", description = "Accept leading BOM bytes (UTF-8).")
@@ -51,7 +52,8 @@ interface MorfologikDictionaryBuilderParams extends EncodingParameter {
@OptionalParameter(defaultValue = "false")
Boolean getOverwrite();
- @ParameterDescription(valueName = "true|false", description = "Validate input to make sure it makes sense.")
+ @ParameterDescription(valueName = "true|false",
+ description = "Validate input to make sure it makes sense.")
@OptionalParameter(defaultValue = "false")
Boolean getValidate();
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/chunker/ChunkSample.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/chunker/ChunkSample.java b/opennlp-tools/src/main/java/opennlp/tools/chunker/ChunkSample.java
index 9aa2e33..174ca61 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/chunker/ChunkSample.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/chunker/ChunkSample.java
@@ -140,7 +140,8 @@ public class ChunkSample {
return phrases.toArray(new Span[phrases.size()]);
}
- private static void validateArguments(int sentenceSize, int tagsSize, int predsSize) throws IllegalArgumentException {
+ private static void validateArguments(int sentenceSize, int tagsSize, int predsSize)
+ throws IllegalArgumentException {
if (sentenceSize != tagsSize || tagsSize != predsSize)
throw new IllegalArgumentException(
"All arrays must have the same length: " +
@@ -152,7 +153,9 @@ public class ChunkSample {
/**
* Creates a nice to read string for the phrases formatted as following: <br>
* <code>
- * [NP Rockwell_NNP ] [VP said_VBD ] [NP the_DT agreement_NN ] [VP calls_VBZ ] [SBAR for_IN ] [NP it_PRP ] [VP to_TO supply_VB ] [NP 200_CD additional_JJ so-called_JJ shipsets_NNS ] [PP for_IN ] [NP the_DT planes_NNS ] ._.
+ * [NP Rockwell_NNP ] [VP said_VBD ] [NP the_DT agreement_NN ] [VP calls_VBZ ] [SBAR for_IN ]
+ * [NP it_PRP ] [VP to_TO supply_VB ] [NP 200_CD additional_JJ so-called_JJ shipsets_NNS ]
+ * [PP for_IN ] [NP the_DT planes_NNS ] ._.
* </code>
*
* @return a nice to read string representation of the chunk phases
@@ -195,7 +198,8 @@ public class ChunkSample {
StringBuilder chunkString = new StringBuilder();
for (int ci = 0; ci < preds.size(); ci++) {
- chunkString.append(sentence.get(ci)).append(" ").append(tags.get(ci)).append(" ").append(preds.get(ci)).append("\n");
+ chunkString.append(sentence.get(ci)).append(" ").append(tags.get(ci))
+ .append(" ").append(preds.get(ci)).append("\n");
}
return chunkString.toString();
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/chunker/ChunkerContextGenerator.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/chunker/ChunkerContextGenerator.java b/opennlp-tools/src/main/java/opennlp/tools/chunker/ChunkerContextGenerator.java
index 25e531a..590bc85 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/chunker/ChunkerContextGenerator.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/chunker/ChunkerContextGenerator.java
@@ -27,9 +27,11 @@ public interface ChunkerContextGenerator extends BeamSearchContextGenerator<Stri
/**
* Returns the contexts for chunking of the specified index.
* @param i The index of the token in the specified toks array for which the context should be constructed.
- * @param toks The tokens of the sentence. The <code>toString</code> methods of these objects should return the token text.
+ * @param toks The tokens of the sentence. The <code>toString</code> methods of these objects
+ * should return the token text.
* @param tags The POS tags for the the specified tokens.
- * @param preds The previous decisions made in the taging of this sequence. Only indices less than i will be examined.
+ * @param preds The previous decisions made in the taging of this sequence.
+ * Only indices less than i will be examined.
* @return An array of predictive contexts on which a model basis its decisions.
*/
String[] getContext(int i, String[] toks, String[] tags, String[] preds);
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/chunker/ChunkerME.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/chunker/ChunkerME.java b/opennlp-tools/src/main/java/opennlp/tools/chunker/ChunkerME.java
index 9ab8e1a..a59b5ce 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/chunker/ChunkerME.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/chunker/ChunkerME.java
@@ -63,8 +63,8 @@ public class ChunkerME implements Chunker {
* @param sequenceValidator The {@link SequenceValidator} to determines whether the outcome
* is valid for the preceding sequence. This can be used to implement constraints
* on what sequences are valid.
- * @deprecated Use {@link #ChunkerME(ChunkerModel, int)} instead
- * and use the {@link ChunkerFactory} to configure the {@link SequenceValidator} and {@link ChunkerContextGenerator}.
+ * @deprecated Use {@link #ChunkerME(ChunkerModel, int)} instead and use the {@link ChunkerFactory}
+ * to configure the {@link SequenceValidator} and {@link ChunkerContextGenerator}.
*/
@Deprecated
private ChunkerME(ChunkerModel model, int beamSize, SequenceValidator<String> sequenceValidator,
@@ -140,7 +140,8 @@ public class ChunkerME implements Chunker {
/**
* Populates the specified array with the probabilities of the last decoded sequence. The
* sequence was determined based on the previous call to <code>chunk</code>. The
- * specified array should be at least as large as the numbe of tokens in the previous call to <code>chunk</code>.
+ * specified array should be at least as large as the numbe of tokens in the previous
+ * call to <code>chunk</code>.
*
* @param probs An array used to hold the probabilities of the last decoded sequence.
*/
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/chunker/DefaultChunkerContextGenerator.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/chunker/DefaultChunkerContextGenerator.java b/opennlp-tools/src/main/java/opennlp/tools/chunker/DefaultChunkerContextGenerator.java
index 387994b..76616d4 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/chunker/DefaultChunkerContextGenerator.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/chunker/DefaultChunkerContextGenerator.java
@@ -30,7 +30,8 @@ public class DefaultChunkerContextGenerator implements ChunkerContextGenerator {
public DefaultChunkerContextGenerator() {
}
- public String[] getContext(int index, String[] sequence, String[] priorDecisions, Object[] additionalContext) {
+ public String[] getContext(int index, String[] sequence,
+ String[] priorDecisions, Object[] additionalContext) {
return getContext(index,sequence,(String[]) additionalContext[0],priorDecisions);
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/ArgumentParser.java
----------------------------------------------------------------------
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 02d1a86..4f103db 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/ArgumentParser.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/ArgumentParser.java
@@ -179,18 +179,22 @@ public class ArgumentParser {
throw new IllegalArgumentException(method.getName() + " method name does not start with 'get'!");
// check that method has zero arguments
- if (method.getParameterTypes().length != 0)
- throw new IllegalArgumentException(method.getName() + " method must have zero parameters but has " +
- method.getParameterTypes().length + "!");
+ if (method.getParameterTypes().length != 0) {
+ throw new IllegalArgumentException(method.getName()
+ + " method must have zero parameters but has "
+ + method.getParameterTypes().length + "!");
+ }
// check return types of interface
Class<?> returnType = method.getReturnType();
Set<Class<?>> compatibleReturnTypes = argumentFactories.keySet();
- if (!compatibleReturnTypes.contains(returnType))
- throw new IllegalArgumentException(method.getName() + " method must have compatible return type! Got " +
- returnType + ", expected one of " + compatibleReturnTypes);
+ if (!compatibleReturnTypes.contains(returnType)) {
+ throw new IllegalArgumentException(method.getName()
+ + " method must have compatible return type! Got "
+ + returnType + ", expected one of " + compatibleReturnTypes);
+ }
}
}
}
@@ -293,7 +297,8 @@ public class ArgumentParser {
if (optional != null)
isOptional = true;
- Argument arg = new Argument(paramName.substring(1), desc.valueName(), desc.description(), isOptional);
+ Argument arg = new Argument(paramName.substring(1),
+ desc.valueName(), desc.description(), isOptional);
arguments.add(arg);
@@ -468,7 +473,8 @@ public class ArgumentParser {
* @return parsed parameters
*
* @throws TerminateToolException if an argument value cannot be parsed.
- * @throws IllegalArgumentException if validateArguments returns false, if the proxy interface is not compatible.
+ * @throws IllegalArgumentException if validateArguments returns false,
+ * if the proxy interface is not compatible.
*/
@SuppressWarnings("unchecked")
public static <T> T parse(String args[], Class<T> argProxyInterface) {
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/CmdLineUtil.java
----------------------------------------------------------------------
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 0b37855..424f297 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/CmdLineUtil.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/CmdLineUtil.java
@@ -330,7 +330,8 @@ public final class CmdLineUtil {
TrainerFactory.TrainerType trainerType = TrainerFactory.getTrainerType(params.getSettings());
- if (!supportSequenceTraining && trainerType.equals(TrainerFactory.TrainerType.EVENT_MODEL_SEQUENCE_TRAINER)) {
+ if (!supportSequenceTraining
+ && trainerType.equals(TrainerFactory.TrainerType.EVENT_MODEL_SEQUENCE_TRAINER)) {
throw new TerminateToolException(1, "Sequence training is not supported!");
}
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/GenerateManualTool.java
----------------------------------------------------------------------
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 cf237c1..36bb951 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/GenerateManualTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/GenerateManualTool.java
@@ -149,7 +149,8 @@ public class GenerateManualTool {
"<informaltable frame='all'><tgroup cols='4' align='left' colsep='1' rowsep='1'>\n");
sb.append(
- "<thead><row><entry>Format</entry><entry>Argument</entry><entry>Value</entry><entry>Optional</entry><entry>Description</entry></row></thead>\n");
+ "<thead><row><entry>Format</entry><entry>Argument</entry><entry>Value</entry>" +
+ "<entry>Optional</entry><entry>Description</entry></row></thead>\n");
sb.append("<tbody>\n");
for (String format : formatArguments.keySet()) {
@@ -198,12 +199,15 @@ public class GenerateManualTool {
+ "KIND, either express or implied. See the License for the\n"
+ "specific language governing permissions and limitations\n"
+ "under the License.\n" + "-->\n" + "\n\n"
- + "<!-- ## Warning ## this content is autogenerated! Please fix issues in to opennlp-tools/src/main/java/opennlp/tools/cmdline/GenerateManualTool.java \n"
+ + "<!-- ## Warning ## this content is autogenerated! Please fix issues in to " +
+ "opennlp-tools/src/main/java/opennlp/tools/cmdline/GenerateManualTool.java \n"
+ " and execute the following command in opennlp-tool folder to update this file: \n\n"
- + " mvn -e -q exec:java \"-Dexec.mainClass=opennlp.tools.cmdline.GenerateManualTool\" \"-Dexec.args=../opennlp-docs/src/docbkx/cli.xml\"\n"
+ + " mvn -e -q exec:java \"-Dexec.mainClass=opennlp.tools.cmdline.GenerateManualTool\" "
+ + "\"-Dexec.args=../opennlp-docs/src/docbkx/cli.xml\"\n"
+ "-->\n\n" + "<chapter id='tools.cli'>\n\n"
+ "<title>The Command Line Interface</title>\n\n" + "<para>"
- + "This section details the available tools and parameters of the Command Line Interface. For a introduction in its usage please refer to <xref linkend='intro.cli'/>. "
+ + "This section details the available tools and parameters of the Command Line Interface. "
+ + "For a introduction in its usage please refer to <xref linkend='intro.cli'/>. "
+ "</para>\n\n");
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/PerformanceMonitor.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/PerformanceMonitor.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/PerformanceMonitor.java
index b0a396f..082b27c 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/PerformanceMonitor.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/PerformanceMonitor.java
@@ -120,8 +120,8 @@ public class PerformanceMonitor {
averageThroughput = 0;
}
- out.printf("current: %.1f " + unit + "/s avg: %.1f " + unit + "/s total: %d " + unit + "%n", currentThroughput,
- averageThroughput, counter);
+ out.printf("current: %.1f " + unit + "/s avg: %.1f " + unit + "/s total: %d "
+ + unit + "%n", currentThroughput, averageThroughput, counter);
lastTimeStamp = System.currentTimeMillis();
lastCount = counter;
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/SystemInputStreamFactory.java
----------------------------------------------------------------------
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 0ecc321..d9f8d3f 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/SystemInputStreamFactory.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/SystemInputStreamFactory.java
@@ -39,7 +39,8 @@ public class SystemInputStreamFactory implements InputStreamFactory {
return System.in;
}
else {
- throw new UnsupportedOperationException("The System.in stream can't be re-created to read from the beginning!");
+ throw new UnsupportedOperationException(
+ "The System.in stream can't be re-created to read from the beginning!");
}
}
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkerMETool.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkerMETool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkerMETool.java
index f479473..c00dc18 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkerMETool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/ChunkerMETool.java
@@ -55,7 +55,8 @@ public class ChunkerMETool extends BasicCmdLineTool {
PerformanceMonitor perfMon = null;
try {
- lineStream = new PlainTextByLineStream(new SystemInputStreamFactory(), SystemInputStreamFactory.encoding());
+ lineStream = new PlainTextByLineStream(new SystemInputStreamFactory(),
+ SystemInputStreamFactory.encoding());
perfMon = new PerformanceMonitor(System.err, "sent");
perfMon.start();
String line;
@@ -72,7 +73,8 @@ public class ChunkerMETool extends BasicCmdLineTool {
String[] chunks = chunker.chunk(posSample.getSentence(), posSample.getTags());
- System.out.println(new ChunkSample(posSample.getSentence(), posSample.getTags(), chunks).nicePrint());
+ System.out.println(new ChunkSample(posSample.getSentence(),
+ posSample.getTags(), chunks).nicePrint());
perfMon.incrementCounter();
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/chunker/TrainingParams.java
----------------------------------------------------------------------
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 09caad5..d2305cb 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
@@ -28,7 +28,8 @@ import opennlp.tools.cmdline.params.BasicTrainingParams;
*/
interface TrainingParams extends BasicTrainingParams {
- @ParameterDescription(valueName = "factoryName", description = "A sub-class of ChunkerFactory where to get implementation and resources.")
+ @ParameterDescription(valueName = "factoryName",
+ description = "A sub-class of ChunkerFactory where to get implementation and resources.")
@OptionalParameter
String getFactory();
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/dictionary/DictionaryBuilderTool.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/dictionary/DictionaryBuilderTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/dictionary/DictionaryBuilderTool.java
index a0992ea..91c8d19 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/dictionary/DictionaryBuilderTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/dictionary/DictionaryBuilderTool.java
@@ -60,7 +60,8 @@ public class DictionaryBuilderTool extends BasicCmdLineTool {
dict.serialize(out);
} catch (IOException e) {
- throw new TerminateToolException(-1, "IO error while reading training data or indexing data: " + e.getMessage(), e);
+ throw new TerminateToolException(-1, "IO error while reading training data or indexing data: "
+ + e.getMessage(), e);
}
}
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/DoccatTool.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/DoccatTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/DoccatTool.java
index 4ff9854..49a55d3 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/DoccatTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/DoccatTool.java
@@ -64,8 +64,8 @@ public class DoccatTool extends BasicCmdLineTool {
perfMon.start();
try {
- documentStream = new ParagraphStream(
- new PlainTextByLineStream(new SystemInputStreamFactory(), SystemInputStreamFactory.encoding()));
+ documentStream = new ParagraphStream(new PlainTextByLineStream(
+ new SystemInputStreamFactory(), SystemInputStreamFactory.encoding()));
String document;
while ((document = documentStream.read()) != null) {
String[] tokens = model.getFactory().getTokenizer().tokenize(document);
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/TrainingParams.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/TrainingParams.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/TrainingParams.java
index f70f3f7..4c4f0df 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/TrainingParams.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/doccat/TrainingParams.java
@@ -28,15 +28,18 @@ import opennlp.tools.cmdline.params.BasicTrainingParams;
*/
interface TrainingParams extends BasicTrainingParams {
- @ParameterDescription(valueName = "fg", description = "Comma separated feature generator classes. Bag of words is used if not specified.")
+ @ParameterDescription(valueName = "fg",
+ description = "Comma separated feature generator classes. Bag of words is used if not specified.")
@OptionalParameter
String getFeatureGenerators();
- @ParameterDescription(valueName = "tokenizer", description = "Tokenizer implementation. WhitespaceTokenizer is used if not specified.")
+ @ParameterDescription(valueName = "tokenizer",
+ description = "Tokenizer implementation. WhitespaceTokenizer is used if not specified.")
@OptionalParameter
String getTokenizer();
- @ParameterDescription(valueName = "factoryName", description = "A sub-class of DoccatFactory where to get implementation and resources.")
+ @ParameterDescription(valueName = "factoryName",
+ description = "A sub-class of DoccatFactory where to get implementation and resources.")
@OptionalParameter
String getFactory();
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/entitylinker/EntityLinkerTool.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/entitylinker/EntityLinkerTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/entitylinker/EntityLinkerTool.java
index f82e362..f248a2c 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/entitylinker/EntityLinkerTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/entitylinker/EntityLinkerTool.java
@@ -121,7 +121,8 @@ public class EntityLinkerTool extends BasicCmdLineTool {
text.append("\n");
}
- List<Span> linkedSpans = entityLinker.find(text.toString(), sentences, tokensBySentence, namesBySentence);
+ List<Span> linkedSpans =
+ entityLinker.find(text.toString(), sentences, tokensBySentence, namesBySentence);
for (int i = 0; i < linkedSpans.size(); i++) {
System.out.println(linkedSpans.get(i));
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/lemmatizer/TrainingParams.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/lemmatizer/TrainingParams.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/lemmatizer/TrainingParams.java
index cd26f54..faaecf5 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/lemmatizer/TrainingParams.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/lemmatizer/TrainingParams.java
@@ -28,8 +28,8 @@ import opennlp.tools.cmdline.params.BasicTrainingParams;
*/
interface TrainingParams extends BasicTrainingParams {
- @ParameterDescription(valueName = "factoryName", description = "A sub-class of LemmatizerFactory where to get implementation and resources.")
+ @ParameterDescription(valueName = "factoryName",
+ description = "A sub-class of LemmatizerFactory where to get implementation and resources.")
@OptionalParameter
String getFactory();
-
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderCrossValidatorTool.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderCrossValidatorTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderCrossValidatorTool.java
index 459a3e5..fab9e15 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderCrossValidatorTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderCrossValidatorTool.java
@@ -92,7 +92,8 @@ public final class TokenNameFinderCrossValidatorTool
sequenceCodecImplName = BilouCodec.class.getName();
}
- SequenceCodec<String> sequenceCodec = TokenNameFinderFactory.instantiateSequenceCodec(sequenceCodecImplName);
+ SequenceCodec<String> sequenceCodec =
+ TokenNameFinderFactory.instantiateSequenceCodec(sequenceCodecImplName);
TokenNameFinderFactory nameFinderFactory;
try {
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderTool.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderTool.java
index 92a846a..2476005 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderTool.java
@@ -67,8 +67,8 @@ public final class TokenNameFinderTool extends BasicCmdLineTool {
perfMon.start();
try {
- untokenizedLineStream =
- new PlainTextByLineStream(new SystemInputStreamFactory(), SystemInputStreamFactory.encoding());
+ untokenizedLineStream = new PlainTextByLineStream(
+ new SystemInputStreamFactory(), SystemInputStreamFactory.encoding());
String line;
while ((line = untokenizedLineStream.read()) != null) {
String whitespaceTokenizerLine[] = WhitespaceTokenizer.INSTANCE.tokenize(line);
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderTrainerTool.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderTrainerTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderTrainerTool.java
index f75f976..8a4bd49 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderTrainerTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/namefind/TokenNameFinderTrainerTool.java
@@ -103,7 +103,8 @@ public final class TokenNameFinderTrainerTool
if (featureGenDescriptor != null) {
try (InputStream xmlDescriptorIn = CmdLineUtil.openInFile(featureGenDescriptor)) {
- artifactSerializers.putAll(GeneratorFactory.extractCustomArtifactSerializerMappings(xmlDescriptorIn));
+ artifactSerializers.putAll(
+ GeneratorFactory.extractCustomArtifactSerializerMappings(xmlDescriptorIn));
} catch (IOException e) {
// TODO: Improve error handling!
e.printStackTrace();
@@ -195,7 +196,8 @@ public final class TokenNameFinderTrainerTool
sequenceCodecImplName = BilouCodec.class.getName();
}
- SequenceCodec<String> sequenceCodec = TokenNameFinderFactory.instantiateSequenceCodec(sequenceCodecImplName);
+ SequenceCodec<String> sequenceCodec =
+ TokenNameFinderFactory.instantiateSequenceCodec(sequenceCodecImplName);
TokenNameFinderFactory nameFinderFactory;
try {
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserTool.java
----------------------------------------------------------------------
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 690e3c0..499fa58 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
@@ -54,7 +54,8 @@ public final class ParserTool extends BasicCmdLineTool {
+ "-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"
- + "-tk tok_model: Use the specified tokenizer model to tokenize the sentences. Defaults to a WhitespaceTokenizer.";
+ + "-tk tok_model: Use the specified tokenizer model to tokenize the sentences. "
+ + "Defaults to a WhitespaceTokenizer.";
}
private static Pattern untokenizedParenPattern1 = Pattern.compile("([^ ])([({)}])");
@@ -124,7 +125,7 @@ public final class ParserTool extends BasicCmdLineTool {
Tokenizer tokenizer = WhitespaceTokenizer.INSTANCE;
String tokenizerModelName = CmdLineUtil.getParameter( "-tk", args );
if (tokenizerModelName != null ) {
- TokenizerModel tokenizerModel = new TokenizerModelLoader().load( new File( tokenizerModelName ) );
+ TokenizerModel tokenizerModel = new TokenizerModelLoader().load(new File(tokenizerModelName));
tokenizer = new TokenizerME( tokenizerModel );
}
@@ -133,7 +134,8 @@ public final class ParserTool extends BasicCmdLineTool {
ObjectStream<String> lineStream = null;
PerformanceMonitor perfMon = null;
try {
- lineStream = new PlainTextByLineStream(new SystemInputStreamFactory(), SystemInputStreamFactory.encoding());
+ lineStream = new PlainTextByLineStream(new SystemInputStreamFactory(),
+ SystemInputStreamFactory.encoding());
perfMon = new PerformanceMonitor(System.err, "sent");
perfMon.start();
String line;
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserTrainerTool.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserTrainerTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserTrainerTool.java
index 928ea29..8779035 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserTrainerTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/parser/ParserTrainerTool.java
@@ -108,7 +108,8 @@ public final class ParserTrainerTool extends AbstractTrainerTool<Parse, TrainerT
return (HeadRules) headRulesObject;
}
else {
- throw new TerminateToolException(-1, "HeadRules Artifact Serializer must create an object of type HeadRules!");
+ throw new TerminateToolException(-1,
+ "HeadRules Artifact Serializer must create an object of type HeadRules!");
}
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerTool.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerTool.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerTool.java
index 61e3225..dc93226 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerTool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/POSTaggerTool.java
@@ -56,7 +56,8 @@ public final class POSTaggerTool extends BasicCmdLineTool {
PerformanceMonitor perfMon = null;
try {
- lineStream = new PlainTextByLineStream(new SystemInputStreamFactory(), SystemInputStreamFactory.encoding());
+ lineStream =
+ new PlainTextByLineStream(new SystemInputStreamFactory(), SystemInputStreamFactory.encoding());
perfMon = new PerformanceMonitor(System.err, "sent");
perfMon.start();
String line;
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/TrainingParams.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/TrainingParams.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/TrainingParams.java
index 6295533..221dcbe 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/TrainingParams.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/postag/TrainingParams.java
@@ -30,7 +30,8 @@ import opennlp.tools.cmdline.params.BasicTrainingParams;
*/
interface TrainingParams extends BasicTrainingParams {
- @ParameterDescription(valueName = "maxent|perceptron|perceptron_sequence", description = "The type of the token name finder model. One of maxent|perceptron|perceptron_sequence.")
+ @ParameterDescription(valueName = "maxent|perceptron|perceptron_sequence",
+ description = "The type of the token name finder model. One of maxent|perceptron|perceptron_sequence.")
@OptionalParameter(defaultValue = "maxent")
String getType();
@@ -38,15 +39,18 @@ interface TrainingParams extends BasicTrainingParams {
@OptionalParameter
File getDict();
- @ParameterDescription(valueName = "cutoff", description = "NGram cutoff. If not specified will not create ngram dictionary.")
+ @ParameterDescription(valueName = "cutoff",
+ description = "NGram cutoff. If not specified will not create ngram dictionary.")
@OptionalParameter
Integer getNgram();
- @ParameterDescription(valueName = "tagDictCutoff", description = "TagDictionary cutoff. If specified will create/expand a mutable TagDictionary")
+ @ParameterDescription(valueName = "tagDictCutoff",
+ description = "TagDictionary cutoff. If specified will create/expand a mutable TagDictionary")
@OptionalParameter
Integer getTagDictCutoff();
- @ParameterDescription(valueName = "factoryName", description = "A sub-class of POSTaggerFactory where to get implementation and resources.")
+ @ParameterDescription(valueName = "factoryName",
+ description = "A sub-class of POSTaggerFactory where to get implementation and resources.")
@OptionalParameter
String getFactory();
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/SentenceDetectorTool.java
----------------------------------------------------------------------
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 3aaf274..9b759b4 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
@@ -63,8 +63,8 @@ public final class SentenceDetectorTool extends BasicCmdLineTool {
perfMon.start();
try {
- ObjectStream<String> paraStream = new ParagraphStream(new PlainTextByLineStream(new SystemInputStreamFactory(),
- SystemInputStreamFactory.encoding()));
+ ObjectStream<String> paraStream = new ParagraphStream(new PlainTextByLineStream(
+ new SystemInputStreamFactory(), SystemInputStreamFactory.encoding()));
String para;
while ((para = paraStream.read()) != null) {
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/TrainingParams.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/TrainingParams.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/TrainingParams.java
index f272291..fbdf4db 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/TrainingParams.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/sentdetect/TrainingParams.java
@@ -38,7 +38,8 @@ interface TrainingParams extends BasicTrainingParams {
@OptionalParameter
String getEosChars();
- @ParameterDescription(valueName = "factoryName", description = "A sub-class of SentenceDetectorFactory where to get implementation and resources.")
+ @ParameterDescription(valueName = "factoryName",
+ description = "A sub-class of SentenceDetectorFactory where to get implementation and resources.")
@OptionalParameter
String getFactory();
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/cmdline/tokenizer/TrainingParams.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/cmdline/tokenizer/TrainingParams.java b/opennlp-tools/src/main/java/opennlp/tools/cmdline/tokenizer/TrainingParams.java
index 0405833..237173a 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/cmdline/tokenizer/TrainingParams.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/cmdline/tokenizer/TrainingParams.java
@@ -29,7 +29,8 @@ import opennlp.tools.cmdline.params.BasicTrainingParams;
* Note: Do not use this class, internal use only!
*/
interface TrainingParams extends BasicTrainingParams {
- @ParameterDescription(valueName = "isAlphaNumOpt", description = "Optimization flag to skip alpha numeric tokens for further tokenization")
+ @ParameterDescription(valueName = "isAlphaNumOpt",
+ description = "Optimization flag to skip alpha numeric tokens for further tokenization")
@OptionalParameter(defaultValue = "false")
Boolean getAlphaNumOpt();
@@ -37,7 +38,8 @@ interface TrainingParams extends BasicTrainingParams {
@OptionalParameter
File getAbbDict();
- @ParameterDescription(valueName = "factoryName", description = "A sub-class of TokenizerFactory where to get implementation and resources.")
+ @ParameterDescription(valueName = "factoryName",
+ description = "A sub-class of TokenizerFactory where to get implementation and resources.")
@OptionalParameter
String getFactory();
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/dictionary/serializer/DictionarySerializer.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/dictionary/serializer/DictionarySerializer.java b/opennlp-tools/src/main/java/opennlp/tools/dictionary/serializer/DictionarySerializer.java
index 13f8927..2cee45d 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/dictionary/serializer/DictionarySerializer.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/dictionary/serializer/DictionarySerializer.java
@@ -238,7 +238,8 @@ public class DictionarySerializer {
* @param entries entries to serialize
*
* @throws IOException If an I/O error occurs
- * @deprecated Use {@link DictionarySerializer#serialize(java.io.OutputStream, java.util.Iterator, boolean)} instead
+ * @deprecated Use
+ * {@link DictionarySerializer#serialize(java.io.OutputStream, java.util.Iterator, boolean)} instead
*/
@Deprecated
public static void serialize(OutputStream out, Iterator<Entry> entries)
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/doccat/DocumentCategorizerEventStream.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/doccat/DocumentCategorizerEventStream.java b/opennlp-tools/src/main/java/opennlp/tools/doccat/DocumentCategorizerEventStream.java
index 77da891..3fbe63d 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/doccat/DocumentCategorizerEventStream.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/doccat/DocumentCategorizerEventStream.java
@@ -37,7 +37,8 @@ public class DocumentCategorizerEventStream extends AbstractEventStream<Document
*
* @param featureGenerators the feature generators
*/
- public DocumentCategorizerEventStream(ObjectStream<DocumentSample> data, FeatureGenerator... featureGenerators) {
+ public DocumentCategorizerEventStream(ObjectStream<DocumentSample> data,
+ FeatureGenerator... featureGenerators) {
super(data);
mContextGenerator =
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/doccat/DocumentSampleStream.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/doccat/DocumentSampleStream.java b/opennlp-tools/src/main/java/opennlp/tools/doccat/DocumentSampleStream.java
index e81f9f5..b35742f 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/doccat/DocumentSampleStream.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/doccat/DocumentSampleStream.java
@@ -24,11 +24,13 @@ import opennlp.tools.util.FilterObjectStream;
import opennlp.tools.util.ObjectStream;
/**
- * This class reads in string encoded training samples, parses them and outputs {@link DocumentSample} objects.
+ * This class reads in string encoded training samples, parses them and
+ * outputs {@link DocumentSample} objects.
* <p>
* Format:<br>
* Each line contains one sample document.<br>
- * The category is the first string in the line followed by a tab and whitespace separated document tokens.<br>
+ * The category is the first string in the line followed by a tab and whitespace
+ * separated document tokens.<br>
* Sample line: category-string tab-char whitespace-separated-tokens line-break-char(s)<br>
*/
public class DocumentSampleStream extends FilterObjectStream<String, DocumentSample> {
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/doccat/NGramFeatureGenerator.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/doccat/NGramFeatureGenerator.java b/opennlp-tools/src/main/java/opennlp/tools/doccat/NGramFeatureGenerator.java
index ef5d2a3..8283adc 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/doccat/NGramFeatureGenerator.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/doccat/NGramFeatureGenerator.java
@@ -47,10 +47,12 @@ public class NGramFeatureGenerator implements FeatureGenerator {
this.minGram = minGram;
this.maxGram = maxGram;
} else {
- throw new InvalidFormatException("Minimum range value (minGram) should be less than or equal to maximum range value (maxGram)!");
+ throw new InvalidFormatException(
+ "Minimum range value (minGram) should be less than or equal to maximum range value (maxGram)!");
}
} else {
- throw new InvalidFormatException("Both minimum range value (minGram) & maximum range value (maxGram) should be greater than or equal to 1!");
+ throw new InvalidFormatException("Both minimum range value (minGram) & maximum " +
+ "range value (maxGram) should be greater than or equal to 1!");
}
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinker.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinker.java b/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinker.java
index 2533bcd..6f06bc7 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinker.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinker.java
@@ -89,5 +89,6 @@ public interface EntityLinker<T extends Span> {
* Span[] corresponds to
* @return
*/
- List<T> find(String doctext, Span[] sentences, Span[][] tokensBySentence, Span[][] namesBySentence, int sentenceIndex);
+ List<T> find(String doctext, Span[] sentences, Span[][] tokensBySentence,
+ Span[][] namesBySentence, int sentenceIndex);
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinkerFactory.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinkerFactory.java b/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinkerFactory.java
index f29a087..1c1f67c 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinkerFactory.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinkerFactory.java
@@ -39,7 +39,8 @@ public class EntityLinkerFactory {
* @return an EntityLinker impl
* @throws java.io.IOException
*/
- public static synchronized EntityLinker<?> getLinker(String entityType, EntityLinkerProperties properties) throws IOException {
+ public static synchronized EntityLinker<?> getLinker(String entityType, EntityLinkerProperties properties)
+ throws IOException {
if (entityType == null || properties == null) {
throw new IllegalArgumentException("Null argument in entityLinkerFactory");
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/entitylinker/LinkedSpan.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/entitylinker/LinkedSpan.java b/opennlp-tools/src/main/java/opennlp/tools/entitylinker/LinkedSpan.java
index 31c0803..8d7dc44 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/entitylinker/LinkedSpan.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/entitylinker/LinkedSpan.java
@@ -113,7 +113,8 @@ public class LinkedSpan<T extends BaseLink> extends Span {
@Override
public String toString() {
- return "LinkedSpan\nsentenceid=" + sentenceid + "\nsearchTerm=" + searchTerm + "\nlinkedEntries=\n" + linkedEntries + "\n";
+ return "LinkedSpan\nsentenceid=" + sentenceid + "\nsearchTerm=" + searchTerm
+ + "\nlinkedEntries=\n" + linkedEntries + "\n";
}
@Override
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/BioNLP2004NameSampleStream.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/BioNLP2004NameSampleStream.java b/opennlp-tools/src/main/java/opennlp/tools/formats/BioNLP2004NameSampleStream.java
index 4f62a3a..ce993f0 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/BioNLP2004NameSampleStream.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/BioNLP2004NameSampleStream.java
@@ -154,7 +154,8 @@ public class BioNLP2004NameSampleStream implements ObjectStream<NameSample> {
if (beginIndex != -1)
names.add(new Span(beginIndex, endIndex, tags.get(beginIndex).substring(2)));
- return new NameSample(sentence.toArray(new String[sentence.size()]), names.toArray(new Span[names.size()]), isClearAdaptiveData);
+ return new NameSample(sentence.toArray(new String[sentence.size()]),
+ names.toArray(new Span[names.size()]), isClearAdaptiveData);
}
else if (line != null) {
// Just filter out empty events, if two lines in a row are empty
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/Conll02NameSampleStream.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/Conll02NameSampleStream.java b/opennlp-tools/src/main/java/opennlp/tools/formats/Conll02NameSampleStream.java
index f1986e7..8ceb957 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/Conll02NameSampleStream.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/Conll02NameSampleStream.java
@@ -193,7 +193,8 @@ public class Conll02NameSampleStream implements ObjectStream<NameSample> {
if (beginIndex != -1)
names.add(extract(beginIndex, endIndex, tags.get(beginIndex)));
- return new NameSample(sentence.toArray(new String[sentence.size()]), names.toArray(new Span[names.size()]), isClearAdaptiveData);
+ return new NameSample(sentence.toArray(new String[sentence.size()]),
+ names.toArray(new Span[names.size()]), isClearAdaptiveData);
}
else if (line != null) {
// Just filter out empty events, if two lines in a row are empty
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/Conll03NameSampleStream.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/Conll03NameSampleStream.java b/opennlp-tools/src/main/java/opennlp/tools/formats/Conll03NameSampleStream.java
index f2498b8..d5354b9 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/Conll03NameSampleStream.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/Conll03NameSampleStream.java
@@ -178,7 +178,8 @@ public class Conll03NameSampleStream implements ObjectStream<NameSample> {
if (beginIndex != -1)
names.add(extract(beginIndex, endIndex, tags.get(beginIndex)));
- return new NameSample(sentence.toArray(new String[sentence.size()]), names.toArray(new Span[names.size()]), isClearAdaptiveData);
+ return new NameSample(sentence.toArray(new String[sentence.size()]),
+ names.toArray(new Span[names.size()]), isClearAdaptiveData);
}
else if (line != null) {
// Just filter out empty events, if two lines in a row are empty
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/ConllXPOSSampleStream.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/ConllXPOSSampleStream.java b/opennlp-tools/src/main/java/opennlp/tools/formats/ConllXPOSSampleStream.java
index 4ca6374..74ae62a 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/ConllXPOSSampleStream.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/ConllXPOSSampleStream.java
@@ -92,7 +92,8 @@ public class ConllXPOSSampleStream extends FilterObjectStream<String, POSSample>
if (tokens.size() == 0)
sample = read();
- sample = new POSSample(tokens.toArray(new String[tokens.size()]), tags.toArray(new String[tags.size()]));
+ sample = new POSSample(tokens.toArray(new String[tokens.size()]),
+ tags.toArray(new String[tags.size()]));
}
return sample;
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/EvalitaNameSampleStream.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/EvalitaNameSampleStream.java b/opennlp-tools/src/main/java/opennlp/tools/formats/EvalitaNameSampleStream.java
index 68a57fb..de2c543 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/EvalitaNameSampleStream.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/EvalitaNameSampleStream.java
@@ -206,7 +206,8 @@ public class EvalitaNameSampleStream implements ObjectStream<NameSample> {
if (beginIndex != -1)
names.add(extract(beginIndex, endIndex, tags.get(beginIndex)));
- return new NameSample(sentence.toArray(new String[sentence.size()]), names.toArray(new Span[names.size()]), isClearAdaptiveData);
+ return new NameSample(sentence.toArray(new String[sentence.size()]),
+ names.toArray(new Span[names.size()]), isClearAdaptiveData);
}
else if (line != null) {
// Just filter out empty events, if two lines in a row are empty
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/LeipzigDoccatSampleStream.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/LeipzigDoccatSampleStream.java b/opennlp-tools/src/main/java/opennlp/tools/formats/LeipzigDoccatSampleStream.java
index a9c734a..321f7c4 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/LeipzigDoccatSampleStream.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/LeipzigDoccatSampleStream.java
@@ -50,7 +50,8 @@ public class LeipzigDoccatSampleStream extends
* Creates a new LeipzigDoccatSampleStream with the specified parameters.
*
* @param language the Leipzig input sentences.txt file
- * @param sentencesPerDocument the number of sentences which should be grouped into once {@link DocumentSample}
+ * @param sentencesPerDocument the number of sentences which
+ * should be grouped into once {@link DocumentSample}
* @param in the InputStream pointing to the contents of the sentences.txt input file
* @throws IOException IOException
*/
@@ -67,7 +68,8 @@ public class LeipzigDoccatSampleStream extends
* Creates a new LeipzigDoccatSampleStream with the specified parameters.
*
* @param language the Leipzig input sentences.txt file
- * @param sentencesPerDocument the number of sentences which should be grouped into once {@link DocumentSample}
+ * @param sentencesPerDocument the number of sentences which should be
+ * grouped into once {@link DocumentSample}
* @param in the InputStream pointing to the contents of the sentences.txt input file
* @throws IOException IOException
*/
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADNameSampleStream.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADNameSampleStream.java b/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADNameSampleStream.java
index 1741999..5b4b926 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADNameSampleStream.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADNameSampleStream.java
@@ -71,7 +71,8 @@ public class ADNameSampleStream implements ObjectStream<NameSample> {
private static final Pattern whitespacePattern = Pattern.compile("\\s+");
private static final Pattern underlinePattern = Pattern.compile("[_]+");
- private static final Pattern hyphenPattern = Pattern.compile("((\\p{L}+)-$)|(^-(\\p{L}+)(.*))|((\\p{L}+)-(\\p{L}+)(.*))");
+ private static final Pattern hyphenPattern =
+ Pattern.compile("((\\p{L}+)-$)|(^-(\\p{L}+)(.*))|((\\p{L}+)-(\\p{L}+)(.*))");
private static final Pattern alphanumericPattern = Pattern.compile("^[\\p{L}\\p{Nd}]+$");
/**
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADNameSampleStreamFactory.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADNameSampleStreamFactory.java b/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADNameSampleStreamFactory.java
index c93764a..e9603a8 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADNameSampleStreamFactory.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADNameSampleStreamFactory.java
@@ -50,7 +50,8 @@ public class ADNameSampleStreamFactory extends LanguageSampleStreamFactory<NameS
@ParameterDescription(valueName = "sampleData", description = "data to be used, usually a file name.")
File getData();
- @ParameterDescription(valueName = "split", description = "if true all hyphenated tokens will be separated (default true)")
+ @ParameterDescription(valueName = "split",
+ description = "if true all hyphenated tokens will be separated (default true)")
@OptionalParameter(defaultValue = "true")
Boolean getSplitHyphenatedTokens();
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADPOSSampleStreamFactory.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADPOSSampleStreamFactory.java b/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADPOSSampleStreamFactory.java
index a551635..ab97ae2 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADPOSSampleStreamFactory.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADPOSSampleStreamFactory.java
@@ -39,7 +39,8 @@ public class ADPOSSampleStreamFactory extends
LanguageSampleStreamFactory<POSSample> {
interface Parameters {
- @ParameterDescription(valueName = "charsetName", description = "encoding for reading and writing text, if absent the system default is used.")
+ @ParameterDescription(valueName = "charsetName",
+ description = "encoding for reading and writing text, if absent the system default is used.")
Charset getEncoding();
@ParameterDescription(valueName = "sampleData", description = "data to be used, usually a file name.")
@@ -52,7 +53,8 @@ public class ADPOSSampleStreamFactory extends
@OptionalParameter(defaultValue = "false")
Boolean getExpandME();
- @ParameterDescription(valueName = "includeFeatures", description = "combine POS Tags with word features, like number and gender.")
+ @ParameterDescription(valueName = "includeFeatures",
+ description = "combine POS Tags with word features, like number and gender.")
@OptionalParameter(defaultValue = "false")
Boolean getIncludeFeatures();
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADSentenceSampleStreamFactory.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADSentenceSampleStreamFactory.java b/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADSentenceSampleStreamFactory.java
index 4e2828f..59ebe46 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADSentenceSampleStreamFactory.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADSentenceSampleStreamFactory.java
@@ -48,7 +48,8 @@ public class ADSentenceSampleStreamFactory extends
@ParameterDescription(valueName = "language", description = "language which is being processed.")
String getLang();
- @ParameterDescription(valueName = "includeTitles", description = "if true will include sentences marked as headlines.")
+ @ParameterDescription(valueName = "includeTitles",
+ description = "if true will include sentences marked as headlines.")
@OptionalParameter(defaultValue = "false")
Boolean getIncludeTitles();
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/brat/BratNameSampleStream.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/brat/BratNameSampleStream.java b/opennlp-tools/src/main/java/opennlp/tools/formats/brat/BratNameSampleStream.java
index 6f75c3e..499b99d 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/brat/BratNameSampleStream.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/brat/BratNameSampleStream.java
@@ -137,8 +137,9 @@ public class BratNameSampleStream extends SegmenterObjectStream<BratDocument, Na
names.add(new Span(nameBeginIndex, nameEndIndex, entity.getType()));
}
else {
- System.err.println("Dropped entity " + entity.getId() + " (" + entitySpan.getCoveredText(sample.getText()) + ") " + " in document " +
- sample.getId() + ", it is not matching tokenization!");
+ System.err.println("Dropped entity " + entity.getId() + " ("
+ + entitySpan.getCoveredText(sample.getText()) + ") " + " in document "
+ + sample.getId() + ", it is not matching tokenization!");
}
}
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/convert/NameToSentenceSampleStream.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/convert/NameToSentenceSampleStream.java b/opennlp-tools/src/main/java/opennlp/tools/formats/convert/NameToSentenceSampleStream.java
index 554d0d1..b5f3196 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/convert/NameToSentenceSampleStream.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/convert/NameToSentenceSampleStream.java
@@ -26,7 +26,8 @@ import opennlp.tools.util.ObjectStream;
*/
public class NameToSentenceSampleStream extends AbstractToSentenceSampleStream<NameSample> {
- public NameToSentenceSampleStream(Detokenizer detokenizer, ObjectStream<NameSample> samples, int chunkSize) {
+ public NameToSentenceSampleStream(Detokenizer detokenizer,
+ ObjectStream<NameSample> samples, int chunkSize) {
super(detokenizer, samples, chunkSize);
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/convert/ParseToPOSSampleStreamFactory.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/convert/ParseToPOSSampleStreamFactory.java b/opennlp-tools/src/main/java/opennlp/tools/formats/convert/ParseToPOSSampleStreamFactory.java
index cafb7ee..4c4c7f0 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/convert/ParseToPOSSampleStreamFactory.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/convert/ParseToPOSSampleStreamFactory.java
@@ -37,7 +37,8 @@ public class ParseToPOSSampleStreamFactory extends LanguageSampleStreamFactory<P
public ObjectStream<POSSample> create(String[] args) {
- ParseSampleStreamFactory.Parameters params = ArgumentParser.parse(args, ParseSampleStreamFactory.Parameters.class);
+ ParseSampleStreamFactory.Parameters params =
+ ArgumentParser.parse(args, ParseSampleStreamFactory.Parameters.class);
ObjectStream<Parse> parseSampleStream = StreamFactoryRegistry.getFactory(Parse.class,
StreamFactoryRegistry.DEFAULT_FORMAT).create(
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitParseSampleStreamFactory.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitParseSampleStreamFactory.java b/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitParseSampleStreamFactory.java
index 432d625..6985a30 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitParseSampleStreamFactory.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/frenchtreebank/ConstitParseSampleStreamFactory.java
@@ -41,8 +41,8 @@ public class ConstitParseSampleStreamFactory extends AbstractSampleStreamFactory
Parameters params = ArgumentParser.parse(args, Parameters.class);
- return new ConstitParseSampleStream(new FileToByteArraySampleStream(new DirectorySampleStream(params.getData(),
- null, false)));
+ return new ConstitParseSampleStream(new FileToByteArraySampleStream(
+ new DirectorySampleStream(params.getData(), null, false)));
}
public static void registerFactory() {
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/muc/Muc6NameSampleStreamFactory.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/muc/Muc6NameSampleStreamFactory.java b/opennlp-tools/src/main/java/opennlp/tools/formats/muc/Muc6NameSampleStreamFactory.java
index e5ef4a2..a64ffc2 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/muc/Muc6NameSampleStreamFactory.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/muc/Muc6NameSampleStreamFactory.java
@@ -54,7 +54,8 @@ public class Muc6NameSampleStreamFactory extends AbstractSampleStreamFactory<Nam
ObjectStream<String> mucDocStream = new FileToStringSampleStream(
new DirectorySampleStream(params.getData(),
- file -> StringUtil.toLowerCase(file.getName()).endsWith(".sgm"), false), Charset.forName("UTF-8"));
+ file -> StringUtil.toLowerCase(file.getName()).endsWith(".sgm"), false),
+ Charset.forName("UTF-8"));
return new MucNameSampleStream(tokenizer, mucDocStream);
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/formats/ontonotes/OntoNotesNameSampleStreamFactory.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/ontonotes/OntoNotesNameSampleStreamFactory.java b/opennlp-tools/src/main/java/opennlp/tools/formats/ontonotes/OntoNotesNameSampleStreamFactory.java
index f3ab66f..167e6db 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/ontonotes/OntoNotesNameSampleStreamFactory.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/ontonotes/OntoNotesNameSampleStreamFactory.java
@@ -48,11 +48,12 @@ public class OntoNotesNameSampleStreamFactory extends
return file.isDirectory();
}, true);
- return new OntoNotesNameSampleStream(new FileToStringSampleStream(documentStream, Charset.forName("UTF-8")));
+ return new OntoNotesNameSampleStream(
+ new FileToStringSampleStream(documentStream, Charset.forName("UTF-8")));
}
public static void registerFactory() {
StreamFactoryRegistry.registerFactory(NameSample.class,
"ontonotes", new OntoNotesNameSampleStreamFactory());
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/languagemodel/NGramLanguageModel.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/languagemodel/NGramLanguageModel.java b/opennlp-tools/src/main/java/opennlp/tools/languagemodel/NGramLanguageModel.java
index 47e9e77..f13651b 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/languagemodel/NGramLanguageModel.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/languagemodel/NGramLanguageModel.java
@@ -27,9 +27,10 @@ import opennlp.tools.ngram.NGramUtils;
import opennlp.tools.util.StringList;
/**
- * A�{@link opennlp.tools.languagemodel.LanguageModel} based on a {@link opennlp.tools.ngram.NGramModel} using Laplace
- * smoothing probability estimation to get the probabilities of the ngrams.
- * See also {@link NGramUtils#calculateLaplaceSmoothingProbability(opennlp.tools.util.StringList, Iterable, int, Double)}.
+ * A�{@link opennlp.tools.languagemodel.LanguageModel} based on a {@link opennlp.tools.ngram.NGramModel}
+ * using Laplace smoothing probability estimation to get the probabilities of the ngrams.
+ * See also {@link NGramUtils#calculateLaplaceSmoothingProbability(
+ * opennlp.tools.util.StringList, Iterable, int, Double)}.
*/
public class NGramLanguageModel extends NGramModel implements LanguageModel {
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/DefaultLemmatizerContextGenerator.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/DefaultLemmatizerContextGenerator.java b/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/DefaultLemmatizerContextGenerator.java
index cba1c14..cdd2383 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/DefaultLemmatizerContextGenerator.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/DefaultLemmatizerContextGenerator.java
@@ -55,7 +55,8 @@ public class DefaultLemmatizerContextGenerator implements LemmatizerContextGener
return suffs;
}
- public String[] getContext(int index, String[] sequence, String[] priorDecisions, Object[] additionalContext) {
+ public String[] getContext(int index, String[] sequence, String[] priorDecisions,
+ Object[] additionalContext) {
return getContext(index, sequence, (String[]) additionalContext[0], priorDecisions);
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmaSample.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmaSample.java b/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmaSample.java
index 8dbfc24..553eb3a 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmaSample.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmaSample.java
@@ -76,7 +76,8 @@ public class LemmaSample {
return lemmas.toArray(new String[lemmas.size()]);
}
- private void validateArguments(int tokensSize, int tagsSize, int lemmasSize) throws IllegalArgumentException {
+ private void validateArguments(int tokensSize, int tagsSize, int lemmasSize)
+ throws IllegalArgumentException {
if (tokensSize != tagsSize || tagsSize != lemmasSize) {
throw new IllegalArgumentException(
"All arrays must have the same length: " +
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmaSampleEventStream.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmaSampleEventStream.java b/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmaSampleEventStream.java
index 5915973..fc1a558 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmaSampleEventStream.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmaSampleEventStream.java
@@ -51,7 +51,8 @@ public class LemmaSampleEventStream extends AbstractEventStream<LemmaSample> {
String[] tagsArray = sample.getTags();
String[] lemmasArray = sample.getLemmas();
for (int ei = 0, el = sample.getTokens().length; ei < el; ei++) {
- events.add(new Event(lemmasArray[ei], contextGenerator.getContext(ei,toksArray,tagsArray,lemmasArray)));
+ events.add(new Event(lemmasArray[ei],
+ contextGenerator.getContext(ei,toksArray,tagsArray,lemmasArray)));
}
return events.iterator();
}
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmatizerContextGenerator.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmatizerContextGenerator.java b/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmatizerContextGenerator.java
index 6dc1e6e..1b6fc0b 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmatizerContextGenerator.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmatizerContextGenerator.java
@@ -27,9 +27,11 @@ public interface LemmatizerContextGenerator extends BeamSearchContextGenerator<S
/**
* Returns the contexts for lemmatizing of the specified index.
* @param i The index of the token in the specified toks array for which the context should be constructed.
- * @param toks The tokens of the sentence. The <code>toString</code> methods of these objects should return the token text.
+ * @param toks The tokens of the sentence. The <code>toString</code> methods of
+ * these objects should return the token text.
* @param tags The POS tags for the the specified tokens.
- * @param lemmas The previous decisions made in the tagging of this sequence. Only indices less than i will be examined.
+ * @param lemmas The previous decisions made in the tagging of this sequence.
+ * Only indices less than i will be examined.
* @return An array of predictive contexts on which a model basis its decisions.
*/
String[] getContext(int i, String[] toks, String[] tags, String[] lemmas);
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmatizerME.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmatizerME.java b/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmatizerME.java
index 2ec5691..98a19f5 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmatizerME.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/lemmatizer/LemmatizerME.java
@@ -123,7 +123,8 @@ public class LemmatizerME implements Lemmatizer {
/**
* Populates the specified array with the probabilities of the last decoded sequence. The
* sequence was determined based on the previous call to <code>lemmatize</code>. The
- * specified array should be at least as large as the number of tokens in the previous call to <code>lemmatize</code>.
+ * specified array should be at least as large as the number of tokens in the
+ * previous call to <code>lemmatize</code>.
*
* @param probs An array used to hold the probabilities of the last decoded sequence.
*/
@@ -169,8 +170,8 @@ public class LemmatizerME implements Lemmatizer {
}
else if (TrainerType.EVENT_MODEL_SEQUENCE_TRAINER.equals(trainerType)) {
LemmaSampleSequenceStream ss = new LemmaSampleSequenceStream(samples, contextGenerator);
- EventModelSequenceTrainer trainer = TrainerFactory.getEventModelSequenceTrainer(trainParams.getSettings(),
- manifestInfoEntries);
+ EventModelSequenceTrainer trainer =
+ TrainerFactory.getEventModelSequenceTrainer(trainParams.getSettings(), manifestInfoEntries);
lemmatizerModel = trainer.train(ss);
}
else if (TrainerType.SEQUENCE_TRAINER.equals(trainerType)) {
http://git-wip-us.apache.org/repos/asf/opennlp/blob/2e1f7e75/opennlp-tools/src/main/java/opennlp/tools/ml/BeamSearch.java
----------------------------------------------------------------------
diff --git a/opennlp-tools/src/main/java/opennlp/tools/ml/BeamSearch.java b/opennlp-tools/src/main/java/opennlp/tools/ml/BeamSearch.java
index e55cb52..4ce8b7e 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/ml/BeamSearch.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/ml/BeamSearch.java
@@ -76,12 +76,15 @@ public class BeamSearch<T> implements SequenceClassificationModel<T> {
* Returns the best sequence of outcomes based on model for this object.
*
* @param sequence The input sequence.
- * @param additionalContext An Object[] of additional context. This is passed to the context generator blindly with the assumption that the context are appropiate.
+ * @param additionalContext An Object[] of additional context.
+ * This is passed to the context generator blindly with the
+ * assumption that the context are appropiate.
*
* @return The top ranked sequence of outcomes or null if no sequence could be found
*/
public Sequence[] bestSequences(int numSequences, T[] sequence,
- Object[] additionalContext, double minSequenceScore, BeamSearchContextGenerator<T> cg, SequenceValidator<T> validator) {
+ Object[] additionalContext, double minSequenceScore,
+ BeamSearchContextGenerator<T> cg, SequenceValidator<T> validator) {
Queue<Sequence> prev = new PriorityQueue<>(size);
Queue<Sequence> next = new PriorityQueue<>(size);