Skip to content

Commit

Permalink
Override init method
Browse files Browse the repository at this point in the history
  • Loading branch information
takahi-i committed Oct 24, 2017
1 parent 3dd663d commit 67df8a0
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package cc.redpen.validator.document;

import cc.redpen.RedPenException;
import cc.redpen.model.*;
import cc.redpen.tokenizer.TokenElement;
import cc.redpen.validator.Validator;
Expand All @@ -26,8 +27,8 @@
import static java.util.Collections.singletonList;

public class JapaneseExpressionVariationValidator extends Validator {
private Map<Document, Map<String, List<CandidateTokenInfo>>> readingMap = new HashMap<>();
private Map<Document, List<Sentence>> sentenceMap = new HashMap<>();
private Map<Document, Map<String, List<CandidateTokenInfo>>> readingMap;
private Map<Document, List<Sentence>> sentenceMap;

class CandidateTokenInfo {
public CandidateTokenInfo(TokenElement element, Sentence sentence) {
Expand Down Expand Up @@ -162,6 +163,12 @@ private List<Sentence> extractSentencesFromSection(Section section) {
return sentencesInSection;
}

@Override
protected void init() throws RedPenException {
this.readingMap = new HashMap<>();
this.sentenceMap = new HashMap<>();
}

@Override
public List<String> getSupportedLanguages() {
return singletonList(Locale.JAPANESE.getLanguage());
Expand Down

0 comments on commit 67df8a0

Please sign in to comment.