Commit Graph
2 Commits
Author SHA1 Message Date
Tirsvad b8e63d0a29 Add the comment extractor and the language detector of the English-comments check
tools/english_comments.py reads the comments and docstrings of the languages of
ADR-0010 (the scanner of count_loc.py now returns the comment text), joins the
lines of a block, removes everything that is not a word and judges the block
with langid (ADR-0012). It checks the lines a branch adds, or every tracked
file, honours an ignore marker and an allowed-words file, and prints each
finding as an annotation. The rates of the corpus are tests.

Refs #199
Refs #200
Refs #203
Task: MIL-013#3
Task: MIL-013#4
2026-10-19 12:34:00 +08:00
Tirsvad 7d8cc4522e Choose the detection method for the English-comments check (ADR-0012)
Compares a rule-based method, langdetect, langid and lingua on the corpus.
langid with a pre-filter and a 0.6 threshold flags 0 of 300 English comments,
44/45 Danish and 41/45 Malay. The comparison script is kept next to the corpus.

Refs #198
Task: MIL-013#2
2026-10-19 12:21:23 +08:00