• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ljacqu / wordeval / 14562965679

20 Apr 2025 08:11PM UTC coverage: 55.116% (+1.7%) from 53.367%
14562965679

push

github

ljacqu
Merge evaluator handlers to EvaluatorService

269 of 568 branches covered (47.36%)

4 of 6 new or added lines in 2 files covered. (66.67%)

87 existing lines in 6 files now uncovered.

738 of 1339 relevant lines covered (55.12%)

3.27 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/ch/jalu/wordeval/WordEvalMain.java
1
package ch.jalu.wordeval;
2

3
import ch.jalu.wordeval.appdata.AppData;
4
import ch.jalu.wordeval.config.SpringContainedRunner;
5
import ch.jalu.wordeval.dictionary.Dictionary;
6
import ch.jalu.wordeval.dictionary.DictionaryService;
7
import ch.jalu.wordeval.dictionary.Word;
8
import ch.jalu.wordeval.evaluators.export.ExportService;
9
import ch.jalu.wordeval.evaluators.processing.EvaluatorCollection;
10
import ch.jalu.wordeval.evaluators.processing.EvaluatorService;
11
import ch.jalu.wordeval.language.Language;
12
import ch.jalu.wordeval.util.TimeLogger;
13
import com.google.common.collect.ImmutableMap;
14
import lombok.extern.slf4j.Slf4j;
15
import org.springframework.beans.factory.annotation.Autowired;
16

17
import java.util.Collection;
18
import java.util.List;
19
import java.util.Map;
20

21
/**
22
 * Entry point of the <i>wordeval</i> application: generates JSON export of the evaluator results.
23
 */
UNCOV
24
@Slf4j
×
UNCOV
25
public class WordEvalMain extends SpringContainedRunner {
×
26

27
  @Autowired
28
  private AppData appData;
29

30
  @Autowired
31
  private DictionaryService dictionaryService;
32

33
  @Autowired
34
  private EvaluatorService evaluatorService;
35

36
  @Autowired
37
  private ExportService exportService;
38

39
  /**
40
   * Entry point method.
41
   *
42
   * @param args .
43
   */
44
  public static void main(String[] args) {
UNCOV
45
    runApplication(WordEvalMain.class, args);
×
UNCOV
46
  }
×
47

48
  @Override
49
  public void run(String... args) {
50
    List<String> codes = List.of("eu", "en-us", "fr");
×
51

52
    for (String code : codes) {
×
53
      exportLanguage(code);
×
54
    }
×
UNCOV
55
  }
×
56

57
  /**
58
   * Exports the evaluator results for a dictionary into the /export folder.
59
   *
60
   * @param code the code of the dictionary to evaluate
61
   */
62
  public void exportLanguage(String code) {
63
    log.info("");
×
64
    log.info("Exporting language '{}'", code);
×
UNCOV
65
    TimeLogger timeLogger = new TimeLogger(log);
×
66

UNCOV
67
    Dictionary dictionary = appData.getDictionary(code);
×
68
    Language language = dictionary.getLanguage();
×
69
    timeLogger.lap("Looked up dictionary");
×
70

NEW
71
    EvaluatorCollection evaluators = evaluatorService.createAllEvaluators(language);
×
UNCOV
72
    timeLogger.lap("Instantiated evaluators. Total: " + evaluators.size());
×
73

74
    Collection<Word> allWords = dictionaryService.readAllWords(dictionary);
×
75
    timeLogger.lap("Loaded all words: total " + allWords.size() + " words");
×
76

NEW
77
    evaluatorService.processAllWords(evaluators, allWords);
×
UNCOV
78
    timeLogger.lap("Ran all words through all evaluators");
×
79

UNCOV
80
    Map<String, String> metaInfo = ImmutableMap.of(
×
81
        "dictionary", code,
UNCOV
82
        "language", language.getName(),
×
UNCOV
83
        "gen_date", String.valueOf(System.currentTimeMillis() / 1000L),
×
UNCOV
84
        "words", String.valueOf(allWords.size()));
×
UNCOV
85
    timeLogger.lap("processed dictionary");
×
86

UNCOV
87
    exportService.export(language, evaluators.streamThroughAllEvaluators());
×
UNCOV
88
    timeLogger.lap("finished export");
×
UNCOV
89
    timeLogger.logWithOverallTime("Finished language '" + code + "'");
×
UNCOV
90
  }
×
91
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc