def leafConverter(self, parseNodeDrawable: ParseNodeDrawable) -> str: layerInfo = parseNodeDrawable.getLayerInfo() rootWords = " " for i in range(layerInfo.getNumberOfWords()): root = layerInfo.getMorphologicalParseAt(i).getWord().getName() if root is not None and len(root) != 0: rootWords += " " + root return rootWords
def satisfies(self, parseNode: ParseNodeDrawable) -> bool: if super().satisfies(parseNode): layerInfo = parseNode.getLayerInfo() for i in range(layerInfo.getNumberOfMeanings()): synSetId = layerInfo.getSemanticAt(i) if synSetId == self.__id: return True return False
def satisfies(self, parseNode: ParseNodeDrawable) -> bool: layerInfo = parseNode.getLayerInfo() if super().satisfies(parseNode) and layerInfo is not None and \ layerInfo.getLayerData(ViewLayerType.SEMANTICS) is not None: for i in range(layerInfo.getNumberOfMeanings()): synSetId = layerInfo.getSemanticAt(i) if self.__wordNet.getSynSetWithId(synSetId) is not None and \ self.__wordNet.getSynSetWithId(synSetId).getPos() == Pos.VERB: return True return False
def modifier(self, parseNode: ParseNodeDrawable): if parseNode.isLeaf(): name = parseNode.getData().getName() parseNode.clearLayers() parseNode.getLayerInfo().setLayerData(ViewLayerType.ENGLISH_WORD, name) parseNode.clearData()
def satisfies(self, parseNode: ParseNodeDrawable) -> bool: layerInfo = parseNode.getLayerInfo() return super().satisfies(parseNode) and layerInfo is not None and \ layerInfo.getLayerData(ViewLayerType.PROPBANK) is not None and \ layerInfo.getLayerData(ViewLayerType.PROPBANK) == "PREDICATE"
def satisfies(self, parseNode: ParseNodeDrawable) -> bool: layerInfo = parseNode.getLayerInfo() return super().satisfies(parseNode) and layerInfo is not None and layerInfo.getArgument() is not None \ and layerInfo.getArgument().getArgumentType() == "PREDICATE"