rzo1 commented on code in PR #85:
URL: https://github.com/apache/opennlp-sandbox/pull/85#discussion_r1111938606
##########
opennlp-similarity/src/main/java/opennlp/tools/apps/relevanceVocabs/SynonymMap.java:
##########
@@ -240,7 +240,7 @@ private HashMap<String,String[]>
createIndex(Map<String,ArrayList<Integer>> word
ArrayList<String> words = group2Words.get(group.get(i));
for (int j=words.size(); --j >= 0; ) { // add all words
String synonym = words.get(j); // note that w and word are interned
- if (synonym != word) { // a word implicitly is its own synonym
+ if (!synonym.equals(word)) { // a word implicitly is its own synonym
Review Comment:
good catch
##########
opennlp-similarity/src/main/java/opennlp/tools/jsmlearning/JSMLearnerOnLatticeWithAbduction.java:
##########
@@ -17,26 +17,8 @@
package opennlp.tools.jsmlearning;
Review Comment:
Looks like we need to enforce formatting rules as a next step.
##########
opennlp-coref/src/main/java/opennlp/tools/coref/mention/DefaultParse.java:
##########
@@ -36,12 +36,12 @@
*/
public class DefaultParse extends AbstractParse {
- public static String[] NAME_TYPES = {"person", "organization", "location",
"date",
+ public static final String[] NAME_TYPES = {"person", "organization",
"location", "date",
"time", "percentage", "money"};
- private Parse parse;
- private int sentenceNumber;
- private static Set<String> entitySet = new
HashSet<String>(Arrays.asList(NAME_TYPES));
+ private final Parse parse;
+ private final int sentenceNumber;
+ private static final Set<String> entitySet = new
HashSet<>(Arrays.asList(NAME_TYPES));
Review Comment:
Do we want to adhere to naming conventions regarding capslock for constants?
##########
opennlp-similarity/src/main/java/opennlp/tools/doc_classifier/ClassifierTrainingSetIndexer.java:
##########
@@ -31,18 +32,18 @@
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
-import org.apache.lucene.util.Version;
import org.apache.tika.Tika;
public class ClassifierTrainingSetIndexer {
- public static String resourceDir = new
File(".").getAbsolutePath().replace("/.", "") + "/src/main/resources";
- public static String INDEX_PATH = "/classif", CLASSIF_TRAINING_CORPUS_PATH =
"/training_corpus";
- protected ArrayList<File> queue = new ArrayList<>();
- Tika tika = new Tika();
+ public static final String resourceDir = new
File(".").getAbsolutePath().replace("/.", "") + "/src/main/resources";
Review Comment:
`RESOURCE_DIR` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]