def check_single(self, source, target, unit): if self.is_language(unit, ("el",)) and source and source[-1] == "?": # Complement to question mark check return False return self.check_chars( strip_entities(source), strip_entities(target), -1, [";"] )
def check_single(self, source, target, unit): if not self.is_language(unit, ("fr", "br")): return False # Remove XML/HTML entities to simplify parsing target = strip_entities(target) whitespace = {" ", "\u00A0", "\u202F", "\u2009"} total = len(target) for i, char in enumerate(target): if char in FRENCH_PUNCTUATION: if i + 1 < total and not target[i + 1].isspace(): continue if i == 0 or target[i - 1] not in whitespace: return True return False