Exemple #1
0
 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 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
Exemple #3
0
 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 ""
Exemple #4
0
 def satisfies(self, parseNode: ParseNodeDrawable) -> bool:
     if super().satisfies(parseNode):
         parentData = parseNode.getParent().getData().getName()
         return parentData == "NNP" or parentData == "NNPS"
     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