hide unknown words if present in the glossary

This commit is contained in:
Vincent Poulailleau 2021-02-02 14:30:21 +01:00
parent 76b77e502b
commit 97bde75feb

View File

@ -13,6 +13,7 @@ from pygrammalecte import (
) )
from padpo.checkers.baseclass import Checker, replace_quotes from padpo.checkers.baseclass import Checker, replace_quotes
from padpo.checkers.glossary import glossary
from padpo.pofile import PoFile, PoItem from padpo.pofile import PoFile, PoItem
log = simplelogging.get_logger() log = simplelogging.get_logger()
@ -93,6 +94,8 @@ class GrammalecteChecker(Checker):
return True # white list return True # white list
if warning.word.endswith("_"): if warning.word.endswith("_"):
return True return True
if warning.word.lower() in glossary:
return True
return False return False
def get_personal_dict(self): def get_personal_dict(self):