def satisfies(self, parseNode: ParseNodeDrawable) -> bool: if super().satisfies(parseNode): data = parseNode.getLayerData(ViewLayerType.ENGLISH_WORD) parentData = parseNode.getParent().getData().getName() return parentData == "CD" and re.fullmatch("[0-9,.]+", data) is not None return False
def satisfies(self, parseNode: ParseNodeDrawable) -> bool: if super().satisfies(parseNode): data = parseNode.getLayerData(ViewLayerType.TURKISH_WORD) parentData = parseNode.getParent().getData().getName() return data is not None and "*" not in data and ( not (data == "0" and parentData == "-NONE-")) return False
def leafConverter(self, leafNode: ParseNodeDrawable) -> str: layerData = leafNode.getLayerData(self.viewLayerType) parentLayerData = leafNode.getParent().getLayerData(self.viewLayerType) if layerData is not None: if "*" in layerData or (layerData == "0" and parentLayerData == "-NONE-"): return "" else: return " " + layerData.replace("-LRB-", "(").replace("-RRB-", ")").replace("-LSB-", "[").\ replace("-RSB-", "]").replace("-LCB-", "{").replace("-RCB-", "}").replace("-lrb-", "(").\ replace("-rrb-", ")").replace("-lsb-", "[").replace("-rsb-", "]").replace("-lcb", "{").\ replace("-rcb-", "}") else: return ""
def satisfies(self, parseNode: ParseNodeDrawable) -> bool: if super().satisfies(parseNode): data = parseNode.getLayerData(self.__secondLanguage) return data is not None and data == "*NONE*" return False
def satisfies(self, parseNode: ParseNodeDrawable) -> bool: if super().satisfies(parseNode): data = parseNode.getLayerData(ViewLayerType.ENGLISH_WORD) parentData = parseNode.getParent().getData().getName() return "*" in data or (data == "0" and parentData == "-NONE-") return False
def satisfies(self, parseNode: ParseNodeDrawable) -> bool: if super().satisfies(parseNode): data = parseNode.getLayerData(ViewLayerType.ENGLISH_WORD) return Word.isPunctuationSymbol(data) and data != "$" return False