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

ljacqu / wordeval / 14540892325

18 Apr 2025 07:50PM UTC coverage: 51.4% (-12.1%) from 63.456%
14540892325

push

github

ljacqu
Merge remote-tracking branch 'origin/master' into dependencies

239 of 546 branches covered (43.77%)

93 of 383 new or added lines in 27 files covered. (24.28%)

5 existing lines in 4 files now uncovered.

679 of 1321 relevant lines covered (51.4%)

3.0 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.dictionary.Dictionary;
5
import ch.jalu.wordeval.dictionary.Word;
6
import ch.jalu.wordeval.evaluators.export.ExportService;
7
import ch.jalu.wordeval.evaluators.processing.EvaluatorInitializer;
8
import ch.jalu.wordeval.evaluators.processing.EvaluatorProcessor;
9
import ch.jalu.wordeval.language.Language;
10
import ch.jalu.wordeval.runners.DictionaryProcessor;
11
import ch.jalu.wordeval.util.TimeLogger;
12
import com.google.common.collect.ImmutableMap;
13
import lombok.extern.log4j.Log4j2;
14

15
import java.util.Collection;
16
import java.util.List;
17
import java.util.Map;
18

19
/**
20
 * Entry point of the <i>wordeval</i> application: generates JSON export of the evaluator results.
21
 */
22
@Log4j2
×
23
public final class WordEvalMain {
24

25
  private final AppData appData;
26

27
  private WordEvalMain() {
×
28
    appData = new AppData();
×
29
  }
×
30

31
  /**
32
   * Entry point method.
33
   *
34
   * @param args .
35
   */
36
  public static void main(String[] args) {
37
    // All codes: Dictionary.getAllCodes()
NEW
38
    List<String> codes = List.of("eu", "en-us", "fr");
×
39

40
    WordEvalMain main = new WordEvalMain();
×
41
    for (String code : codes) {
×
42
      main.exportLanguage(code);
×
43
    }
×
44
  }
×
45

46
  /**
47
   * Exports the evaluator results for a dictionary into the /export folder.
48
   *
49
   * @param code the code of the dictionary to evaluate
50
   */
51
  public void exportLanguage(String code) {
52
    log.info("");
×
53
    log.info("Exporting language '{}'", code);
×
54
    TimeLogger timeLogger = new TimeLogger(log);
×
55

56
    Dictionary dictionary = appData.getDictionary(code);
×
57
    Language language = dictionary.getLanguage();
×
58
    timeLogger.lap("Looked up dictionary");
×
59

60
    EvaluatorInitializer initializer = new EvaluatorInitializer(language);
×
61
    timeLogger.lap("Instantiated evaluators. Total: " + initializer.getEvaluatorsCount());
×
62

63
    Collection<Word> allWords = DictionaryProcessor.readAllWords(dictionary);
×
64
    timeLogger.lap("Loaded all words: total " + allWords.size() + " words");
×
65

66
    EvaluatorProcessor evaluatorProcessor = new EvaluatorProcessor(initializer);
×
67
    evaluatorProcessor.processAllWords(allWords);
×
68
    timeLogger.lap("Ran all words through all evaluators");
×
69

70
    Map<String, String> metaInfo = ImmutableMap.of(
×
71
        "dictionary", code,
72
        "language", language.getName(),
×
73
        "gen_date", String.valueOf(System.currentTimeMillis() / 1000L),
×
74
        "words", String.valueOf(allWords.size()));
×
75
    timeLogger.lap("processed dictionary");
×
76

NEW
77
    ExportService exportService = new ExportService();
×
NEW
78
    exportService.export(language, evaluatorProcessor.streamThroughAllEvaluators());
×
79
    timeLogger.lap("finished export");
×
80
    timeLogger.logWithOverallTime("Finished language '" + code + "'");
×
81
  }
×
82
}
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